dreamstack/examples/springs.ds
enzotar 439a775dec feat(compiler): complete bitstream integration — all 9 changes
- AST: StreamDecl, StreamMode, Declaration::Stream, StreamFrom struct variant
- Lexer: Pixel, Delta, Signals keywords
- Parser: parse_stream_decl with mode block, fixed TokenKind::On match
- Signal graph: streamable flag, SignalManifest, Declaration::Stream detection
- Checker: StreamFrom { source, .. } pattern
- Codegen: DS._initStream(), DS._connectStream(), DS._streamDiff() hooks
- Runtime JS: full streaming layer with binary protocol encoding
- Layout: to_bytes/from_bytes on LayoutRect

82 tests pass (5 new: 3 parser stream + 2 analyzer streamable)
2026-02-25 13:26:59 -08:00

24 lines
569 B
Text

-- DreamStack Springs + 2D Scene
-- Physics-driven rendering. No CSS for animation.
let ball_x = spring(200)
let ball_y = spring(150)
let sidebar_w = spring(240)
view main = column [
text "Spring Physics"
text ball_x
text ball_y
row [
button "Center" { click: ball_x = 200 }
button "Left" { click: ball_x = 50 }
button "Right" { click: ball_x = 350 }
button "Top" { click: ball_y = 50 }
button "Bottom" { click: ball_y = 300 }
]
text sidebar_w
button "Wide" { click: sidebar_w = 300 }
button "Narrow" { click: sidebar_w = 60 }
]