Preskoči na vsebino
Odprta koda

Orb

Formalni jezik za opis vedenja programskih sistemov. Napišite model. Prevajalnik dokaže, da je pravilen.

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

Ena datoteka, celotna aplikacija

Popoln upravljalnik nalog v eni sami datoteki .orb.

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 }

Zakaj Orb?

Napiši enkrat, prevedi za karkoli

En model .orb se prevede v spletno, mobilno, namizno ali katero koli prihodnjo platformo.

Preverjeno s prevajalnikom

Prevajalnik preveri vsak možen zaslon vaše aplikacije. Če se prevede, uporabniki nikoli ne naletijo na pokvarjeno ali manjkajočo stran.

Umetna inteligenca ga generira izvorno

Strukturiran, formalen in kompakten. Modeli umetne inteligence generirajo veljavne programe .orb bolj zanesljivo kot poljubno kodo.

Standardna knjižnica

103 produkcijsko kakovostnih vedenj v 18 domenah.

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

Odprtokodna skupnost

Orb in prevajalnik sta odprtokodna.