Skip to main content

Orb

Orb is a general-purpose language for reactive applications built on a restricted execution model. Every program is a state machine bound to typed data, composed with other machines over declared events. The compiler checks the whole graph before anything runs, then emits the same program as TypeScript, Python, or Rust — UI included.

curl -fsSL https://orb.almadar.io/install.sh | sh

Loading demo…

One File, Full Application

A task manager in one file: the entity, its state machine, and the page. Every transition carries its own effects, so the compiler can see the whole circuit and generate the frontend, backend, and database from it.

task-manager.orb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 app std-todo "1.0.0" "Todo list with Add (modal) and Remove (confirmation) flows, closed-circuit fetch + persist" orbital TodoOrbital { uses Confirmation from "std/behaviors/std-confirmation" uses Modal from "std/behaviors/std-modal" type TodoLoaded = Event { data : [Todo] } "Fired when the Todo collection finishes loading" type TodoLoadFailed = Event { error : string, code : string } "Fired when the Todo collection fails to load" entity Todo [persistent: todos] { id : string! name : string! description : string status : "active" | "inactive" | "pending" = active createdAt : string pendingId : string = "" } trait TodoBrowse -> Todo [interaction, collection] { initial: loading state loading { INIT -> loading (fetch Todo { emit: { failure: TodoLoadFailed, success: TodoLoaded } }) (render-ui main { align: center children: [{ type: spinner }, { color: muted content: "Loading todos…" type: typography variant: caption }] className: py-12 direction: vertical gap: md type: stack }) TodoLoaded -> browsing (render-ui main { children: [{ children: [{ children: [{ name: list-checks, type: icon }, { content: Todos type: typography variant: h2 }] direction: horizontal gap: md type: stack }, { action: ADD_TODO icon: plus label: "Add Todo" type: button variant: primary }] direction: horizontal gap: md justify: between type: stack }, { type: divider }, { entity: ?data fields: [{ icon: check-square label: Name name: name variant: h4 }, { label: Description name: description variant: caption }, { label: Status name: status variant: badge }] itemActions: [{ event: REMOVE_TODO label: Remove variant: danger }] type: data-grid }] className: "max-w-5xl mx-auto w-full" direction: vertical gap: lg type: stack }) TodoLoadFailed -> error (render-ui main { align: center children: [{ color: destructive name: alert-triangle type: icon }, { content: "Failed to load todos" type: typography variant: h3 }, { color: muted content: ?error type: typography variant: body }, { action: INIT icon: rotate-ccw label: Retry type: button variant: primary }] className: py-12 direction: vertical gap: md type: stack }) } state browsing { INIT -> loading (fetch Todo { emit: { failure: TodoLoadFailed, success: TodoLoaded } }) (render-ui main { type: spinner }) } state error { INIT -> loading (fetch Todo { emit: { failure: TodoLoadFailed, success: TodoLoaded } }) (render-ui main { type: spinner }) } emits { TodoLoaded TodoLoadFailed ADD_TODO -> external { id : string row : Todo } REMOVE_TODO -> external { id : string! name : string } } listens { TodoLoadFailed { error : string code : string } TodoPersistor.TODO_ADDED -> INIT TodoPersistor.TODO_REMOVED -> INIT } } ;; Add: configured via `config`, no effects overrides. trait TodoAdd = Modal.traits.ModalRecordModal -> Todo { events { OPEN: ADD_TODO SAVE: TODO_ADDED } config { icon: plus-circle title: "Add Todo" fields: (name description status) mode: create } listens { TodoBrowse.ADD_TODO -> ADD_TODO } } ;; Remove: confirmation dialog. trait TodoRemove = Confirmation.traits.ConfirmActionConfirmation -> Todo { events { REQUEST: REMOVE_TODO CONFIRM: TODO_REMOVED } config { icon: alert-triangle title: "Remove Todo" alertMessage: "Are you sure you want to remove this todo? This cannot be undone." confirmLabel: Remove } listens { TodoBrowse.REMOVE_TODO -> REMOVE_TODO } } ;; Coordinator: side-effects for Add / Remove. Listens to the bound atoms' ;; emits and runs the actual persist calls. trait TodoPersistor -> Todo [lifecycle, instance] { initial: idle state idle { INIT -> idle DO_ADD -> idle (persist create Todo ?data) (emit TODO_ADDED { id: ?data.id }) DO_REMOVE -> idle (persist delete Todo ?id) (emit TODO_REMOVED { id: ?id }) } emits { TODO_ADDED -> external { id : string! } TODO_REMOVED -> external { id : string! } } listens { DO_ADD { data : Todo } DO_REMOVE { id : string! } TodoAdd.TODO_ADDED -> DO_ADD TodoRemove.TODO_REMOVED -> DO_REMOVE } } page "/todos" as TodoPage -> TodoBrowse, TodoAdd, TodoRemove, TodoPersistor }

Why .orb?

The rule is the shape of the graph

No SHIP under pending means a pending order cannot ship. Not an if in four places, not a disabled button. The compiler walks the graph and refuses a modal with no exit, a state nobody can reach, or an event nobody handles.

One program, many languages

An Orb program can only say eight kinds of effect, so a new target is a mapping, not a rewrite. The same machine compiles to TypeScript, Python, or Rust, and the browser and server copies can never disagree about a rule.

Built for humans and LLMs

The structures are declared and the feedback is exact: the compiler names the field, the line, and the fix. A model writes, validates, and repairs. It does not have to be right the first time, and neither do you.

Standard Library

Behaviors are state machines you import. A list page, a wizard, a calendar, a kanban board: bind one to your entity, configure its knobs, rename its events. The topology stays fixed and the compiler checks every wire. Commerce, healthcare, education, games, and more.

Commerce
Healthcare
Education
Finance
Scheduling
Workflow
Social
Media
Gaming
IoT
CRM
Analytics
Communication
Content
Location
HR
Legal
Real Estate
Orb Standard Library ModuleOrb Standard Library Module

Open Source Community

Orb and its compiler are open source. Contribute, report issues, or build something new.