docs: add implementation status, benchmarks, and React comparison to DREAMSTACK.md

This commit is contained in:
enzotar 2026-02-25 01:39:05 -08:00
parent ca45c688df
commit 06cd2371d5

View file

@ -4,6 +4,68 @@
--- ---
## Implementation Status ✅
DreamStack is **real and running** — 6 Rust crates, 34 tests, 8 examples, ~7KB output.
```
.ds source → ds-parser → ds-analyzer → ds-codegen → JavaScript
↓ ↓
ds-types ds-layout
(type checker) (Cassowary solver)
```
### What Works Today
| Feature | Syntax | Status |
|---------|--------|--------|
| Signals | `let count = 0` | ✅ Fine-grained, auto-tracked |
| Derived | `let doubled = count * 2` | ✅ Lazy |
| Interpolation | `"Count: {count}"` | ✅ Reactive |
| Conditional | `when count > 5 -> text "hi"` | ✅ Mount/unmount |
| If/else | `if x then a else b` | ✅ |
| Match | `match state \| Loading -> ...` | ✅ |
| List rendering | `for item in items -> text item` | ✅ Reactive |
| Components | `component Card(title) = ...` | ✅ Props |
| Effects | `effect fetch(id): Result` / `perform` | ✅ Algebraic |
| Streams | `debounce`, `throttle`, `distinct` | ✅ |
| Springs | `spring(target: 0, stiffness: 300)` | ✅ Physics |
| Layout | Cassowary constraint solver | ✅ |
| Types | `Signal<Int>`, `Derived<Bool>` | ✅ Hindley-Milner |
| Dev server | `dreamstack dev app.ds` | ✅ HMR |
### DreamStack vs React
| | **DreamStack** | **React** |
|---|---|---|
| Reactivity | Fine-grained signals, surgical DOM | VDOM diff, re-render subtrees |
| State | `count += 1` direct | `setState(c => c+1)` immutable |
| Derived | `let d = count * 2` auto | `useMemo(() => ..., [deps])` manual |
| Effects | Auto-tracked, algebraic | `useEffect(..., [deps])` manual |
| Conditional | `when x -> text "y"` | `{x && <span>y</span>}` |
| Lists | `for item in items -> ...` | `{items.map(i => ...)}` |
| Animation | Built-in springs | framer-motion (external) |
| Layout | Built-in Cassowary | CSS only |
| Types | Native HM, `Signal<T>` | TypeScript (external) |
| Bundle | **~7KB** | **~175KB** |
| Ecosystem | New | Massive |
### Benchmarks (signal propagation)
| Benchmark | Ops/sec | Signals |
|-----------|---------|---------|
| Wide Fan-Out (1→1000) | 46K | 1,001 |
| Deep Chain (100 deep) | 399K | 100 |
| Diamond Dependency | 189K | 4 |
| Batch Update (50) | 61K | 50 |
| Mixed Read/Write | 242K | 10 |
### Examples
`counter.ds` · `list.ds` · `todomvc.html` · `search.html` · `dashboard.html` · `playground.html` · `showcase.html` · `benchmarks.html`
---
## Vision ## Vision
React was revolutionary in 2013. But it carries a decade of compromises: the virtual DOM, hooks with manual dependency arrays, re-rendering entire subtrees, CSS from 1996, animations bolted on as an afterthought. DreamStack asks: **what would we build today if none of that existed?** React was revolutionary in 2013. But it carries a decade of compromises: the virtual DOM, hooks with manual dependency arrays, re-rendering entire subtrees, CSS from 1996, animations bolted on as an afterthought. DreamStack asks: **what would we build today if none of that existed?**