Every line of Amaze is open to read. Read it ›

All the way down.

The dig from the front page, slowed down: one basketball through every layer, with values read out of the running world and the actual instructions the chip runs. Each layer links to the exact lines that do the work, and every line of the system is here to read.

8Lapisthe appRead the source1,213 lines
The basketball resting on a tilted shelf next to a beach ball, with a magenta ball and a bowling ball on the shelf above.

The table is an app, and an app is just a box that carries its own language. This one speaks physics:

gravity 140
friction 985
restitution average
walls bounce
pair Ball Shelf sweep
pair Ball Ball circle
7Glassthe surfaceRead the source1,832 lines
move rotate resize code

Glass decides which box is under the pointer and draws the halo around it. Drag a handle and the change is written back into the ball’s own bindings.

The basketball is a 60×60 box at x −105, y −69, inside table.

6Aetherthe devicesRead the source222 lines

Every device is a stream. The pointer arrives as mouseX, mouseY and mouseDown, and the ball reads them like any other value. The network will arrive the same way.

5Rosethe objectRead the source2,473 lines
Box Ball Basketball basket
r30
mass6
color#FF7F1A
fx−26902
fy−17834
x−105
sq98
still9383

The basketball is an object with slots. It is a clone of Basketball, which is a clone of Ball, which is a clone of Box. No classes, just prototypes.

fx is its position in 1/256ths of a pixel. still counts the frames since it last moved: 9,383 of them.

4Sigilthe marksRead the source1,432 lines

Its shape slot becomes a list of marks: one ellipse, squashed a little along the last contact, and two stroked SVG paths for the seams.

(ellipse 0 0 30 29 #FF7F1A 985 -167)
(stroke #4A1E00 70 ((M 0 -1000)
  (C 620 -560 620 560 0 1000) …))

A port of Gezira turns those curves into pixel coverage, in fixed point.

3Fluxthe streamsRead the source406 lines

x <- fx / 256 is not an assignment. It says what x is, and every frame the system makes it true again. When fx changes, x follows, then the ball’s position on screen.

Today a loop in Rose runs each object’s bindings in order. Handing them to the Flux engine, sorted by what each one depends on, is next.

2Azoththe grammarRead the source1,102 lines
bind = slotid ws '<' '-' ws rawexpr ';' -> bind
parses to (x ks-div fx 256)

The shape of a KScript program, its objects and their bindings, is a 27-line Azoth grammar, and this is the rule that matched the line. The text after the arrow is captured whole.

That text is then parsed by a hand-written expression parser in Lisp, about 170 lines. Moving expressions into the grammar is next, so all of KScript is defined in one place.

1Primathe compilerRead the source5,887 lines
(st.i (ld.i t 176) 0
  (shl (/ (shr (ld.i (ld.i t 192) 0) 3) 256) 3))

Prima lowers the binding to a small IR, then straight to RISC‑V. Slot 24 is fx, at byte 192 of the object’s table; slot 22 is x, at byte 176.

Numbers carry a 3-bit tag, so the code shifts right to untag, divides, and shifts left to tag the result. 31 instructions, nothing hidden.

RISC‑V hartthe metalRead the source
div a0, a1, a00x02a5c533 at 0xbc244228

Thirty-two bits in memory. The hart fetches them, sees an arithmetic opcode with the multiply-divide extension, and divides register a1 by a0: −26902 ÷ 256 = −105. That is where the basketball is.

Where it is today

Amaze runs in QEMU on a RISC‑V virtual machine. Here is what works and what does not yet.

Works
  • Boots on RISC‑V and compiles Lisp to machine codeKernel, drivers, evaluator and code generator.
  • Compiled KScript that matches its interpreter bit for bitChecked against the interpreter over 300 frames.
  • Vector rendering with SVGA port of Gezira, in fixed point.
  • Saving and resuming the whole worldSurvives kernel rebuilds.
  • Move, resize and rotate anything; edit its source liveThe halo and the inspector are themselves boxes in the scene.
  • Apps as boxes with their own languagesA physics table and a rail network language with signals and schedules.
Not yet
  • Running on a physical boardCandidates include the VisionFive 2 and Milk‑V Mars.
  • NetworkingA small TCP/IP grammar exists; the network layer is next.
  • Shading in NileReflections on the balls, written as Nile‑style processes.
  • All of KScript in AzothThe grammar covers objects and bindings; expressions still use a hand-written parser.
  • Bindings on the Flux engineToday a loop runs each object’s bindings in order, not sorted by dependency.
  • Outline fontsText uses the bootstrap font for now.
  • Asking in plain wordsDescribe what you want and get back a stream definition you can read.
  • Worlds inside screenshotsShare a picture, share the running world.