Complete compiler pipeline from .ds source to reactive browser apps: - ds-parser: lexer (string interpolation, operators, keywords) + recursive descent parser with operator precedence + full AST types - ds-analyzer: signal graph extraction (source/derived classification), topological sort for glitch-free propagation, DOM binding analysis - ds-codegen: JavaScript emitter with embedded reactive runtime (~3KB signal/derived/effect system) and dark-theme CSS design system - ds-cli: build (compile to HTML+JS), dev (live server), check (analyze) Verified working: source signals, derived signals, event handlers, conditional rendering (when), 12 unit tests passing, 6.8KB output.
19 lines
417 B
Text
19 lines
417 B
Text
-- DreamStack Counter Example
|
|
-- A simple reactive counter demonstrating signals, derived values,
|
|
-- and declarative UI with automatic dependency tracking.
|
|
|
|
let count = 0
|
|
let doubled = count * 2
|
|
let label = "hello"
|
|
|
|
view counter =
|
|
column [
|
|
text label
|
|
text doubled
|
|
row [
|
|
button "-" { click: count -= 1 }
|
|
button "+" { click: count += 1 }
|
|
]
|
|
when count > 10 ->
|
|
text "On fire!"
|
|
]
|