Commit graph

112 commits

Author SHA1 Message Date
enzotar
adff40d47f feat: hash-based router + keyed list reconciliation
Phase 7 features:
- route "/path" -> body declarations with hash-based routing
- navigate "/path" built-in function
- DS.route signal tracks current hash path
- DS.matchRoute() with :param pattern matching
- DS.keyedList() for keyed DOM reconciliation
- Route-aware mounting: views + routes compose
- examples/router.ds: 3-page app (home/about/counter)
- State persists across route changes (10818 bytes)
2026-02-25 07:54:00 -08:00
enzotar
06cd2371d5 docs: add implementation status, benchmarks, and React comparison to DREAMSTACK.md 2026-02-25 01:39:05 -08:00
enzotar
ca45c688df feat: for-in list rendering + component system
Phase 6 features:
- ForIn reactive list rendering: for item in items -> body
- Optional index binding: for item, idx in items -> body
- Component declarations: component Name(props) = body
- Component instantiation: ComponentUse { name, props }

Added across 5 crates:
- ds-parser: For/In/Component tokens, ForIn/ComponentDecl AST nodes
- ds-codegen: reactive list effect, component function emission
- ds-types: ForIn/ComponentUse type inference
- local_vars tracking for non-reactive for-in loop vars

Includes examples/list.ds showcasing for-in + when + signals.
2026-02-25 01:33:28 -08:00
enzotar
e3da3b2d8b feat: signal propagation benchmarks + dev server HMR fix
Benchmarks (examples/benchmarks.html):
- Wide Fan-Out: 1→1000 derived signals (46K ops/s)
- Deep Chain: 100-layer propagation (399K ops/s)
- Diamond Dependency: 500 glitch-free diamonds (16K ops/s)
- Batch Updates: 50 sources in single batch (89K ops/s)
- Effect Throughput: 500 effects (135K ops/s)
- Mixed Graph: realistic 10→30→10 topology (247K ops/s)

Dev server fix: replaced EventSource SSE (flickering) with
fetch-based polling every 500ms for stable HMR.
2026-02-25 01:06:07 -08:00
enzotar
c9b1913a57 feat: dev server with file watching + poll-based HMR
- File watcher thread using notify crate (100ms debounce)
- Auto-recompiles .ds files on change with timed output
- Poll-based HMR: client fetches /__hmr every 500ms for version
- Injects HMR script into compiled HTML before </body>
- Error pages rendered with DreamStack styling on compile failure
- Version counter shared between watcher and HTTP server via AtomicU64
2026-02-25 01:01:59 -08:00
enzotar
bbdeb6b82b feat: showcase — What DreamStack Does That Nothing Else Can
Interactive page comparing 5 unique DreamStack capabilities vs React/Svelte/Solid/Vue:
1. Reactivity as a type (Signal<T> in the type system)
2. Algebraic effects (swappable side-effect handlers)
3. Springs are signals (physics auto-propagates through reactive graph)
4. Compile-time dependency graph (static analysis, dead signal elimination)
5. Constraint-based layout (Cassowary solver, not CSS hacks)

Includes live spring physics demo, interactive constraint layout toggle,
side-by-side code comparisons, Elm-style error previews, and comparison table.
2026-02-25 00:34:46 -08:00
enzotar
20ea2cb82e feat: Phase 5 — Live Playground with editor, preview, signal graph, console
- playground.html: full web IDE for DreamStack DSL
- Code editor with auto-compile (500ms debounce) + Ctrl+Enter
- Live preview: renders interactive UI from DreamStack code
- Signal graph: visualizes source signals, derived values, handlers, views
- Console: compile metrics, type inference (Signal<Int>, Derived<Bool>, etc.)
- 4 examples: counter, todo, effects, springs
- Dark theme with purple accent, premium glassmorphism design
2026-02-25 00:27:42 -08:00
enzotar
462663830e feat: Phase 3+4 — Cassowary constraint solver + type system
Phase 3 — Constraint Layout:
- ds-layout crate: Gaussian elimination constraint solver
- eq, gte, lte, sum_eq, ratio constraints with strength priority
- get_rect() for resolving absolute (x,y,w,h) layouts
- 7 tests: simple eq, two-var eq, sums, rects, gte, ratio, 3-panel

Phase 4 — Type System:
- ds-types crate: Signal<T>, Derived<T>, Stream<T>, Spring<T>, View
- Effect types: Http, Storage, Time, Dom, Custom(name)
- Hindley-Milner type checker with signal-awareness
- Elm-inspired error messages (TYPE MISMATCH, UNHANDLED EFFECT, etc.)
- 11 tests: type display, reactive checks, mismatch errors, etc.

Total: 34 tests passing across 6 crates
2026-02-25 00:22:35 -08:00
enzotar
fcf2639d9b feat: Phase 2+3 — effects, streams, springs, search + dashboard
Phase 2 — Effect System & Streams:
- Algebraic effects (perform/handle/handleAsync) for composable,
  testable side-effects with swappable handlers
- Stream engine with map, filter, debounce, throttle, distinct,
  scan, flatMap, merge, fromEvent, fromSignal, fromPromise
- Search-with-autocomplete example: debounce + flatMap + effects

Phase 3 — Spring Physics:
- RK4 integrator with fixed substep and sleep-when-idle scheduler
- Springs are signals — anything that reads spring.value auto-updates
- Dashboard example: spring-animated sidebar, staggered card entrance,
  draggable spring ball with configurable stiffness/damping/mass

Runtime evolution: v0.1 (signals) → v0.2 (+ effects + streams) → v0.3 (+ springs)
2026-02-25 00:13:09 -08:00
enzotar
51cf09336b feat: TodoMVC example with full reactivity
Full todo app using DreamStack's signal runtime:
- Add/toggle/remove individual todos
- Filter by all/active/completed
- Clear completed batch action
- Derived reactive stats (total, active, done counts)
- Premium dark theme with glassmorphism, slide-in animations
- No VDOM, no re-renders — pure signal propagation
2026-02-25 00:06:20 -08:00
enzotar
a634152318 feat: DreamStack compiler foundation — Phase 0/1
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.
2026-02-25 00:03:06 -08:00
enzotar
cc45557248 feat: add DreamStack project vision and detailed implementation plan documentation. 2026-02-24 23:49:59 -08:00