Show HN: Nectar, a Rust-like React that compiles to WebAssembly
Show HN: Nectar, a Rust-like React that compiles to WebAssembly
Nectar compiles to WebAssembly. One language, one binary, zero dependencies. Your entire app - logic, state, rendering - runs in WASM. JavaScript is reduced to a 10 KB syscall layer.
Note: The Svelte demo may time out on first load with 10K products. Try refreshing if it appears blank.
One Rust binary handles everything: compile, format, lint, test, dev server, LSP, package management, SSR. No toolchain to configure.
Performance & Architecture
- O(1) updates per binding. No virtual DOM, no diffing, no reconciliation.
- When a signal changes, only the exact DOM node updates.
- Rust-inspired borrow checker, type system, and exhaustive pattern matching.
- Catch bugs before they ship - not in production.
Zero Dependencies
No npm, no node_modules, no webpack, no bundler. Your app compiles to a .wasm binary and a 3 KB runtime. That's it.
Language Primitives
component, store, router, page, form, auth, payment, upload, db, cache, agent - common web patterns are language primitives, not libraries.
Server-Side Rendering
The same WASM binary runs on the server via wasmtime. Built-in SSR, hydration, and deployment to 29 Cloud Run regions.
How It Works
Your .nectar source compiles to WebAssembly. The browser loads the .wasm and a 10 KB syscall layer. Everything else is WASM.
| Feature | Implementation |
|---|---|
| JavaScript Runtime | 10 KB (DOM syscalls only) |
| Virtual DOM | None - command buffer |
| State Management | WASM signals - O(1) |
| Borrow Checker | Compile-time safety |
| node_modules | Zero. Deleted. |
| GC Pauses | None - linear memory |
| XSS Attacks | Impossible - no eval |
| Auth | HttpOnly cookies by default |
Demo
10,000 products. Canvas rendering engine. Reactive signals. All running in WebAssembly. Side-by-side with Svelte 5.
Contact
Kicking the tires, want early access, or just have thoughts? Drop your email and I'll reach out. It's one person building this, so it comes straight to me.
Comments
No comments yet. Start the discussion.