Assign a variable. Only its readers run.
silmaril makes plain let variables reactive at compile time. No signal API, no framework, and a 1.42 kB runtime.
npm install silmarilimport { $$, $ } from 'silmaril';
export function cart(ui) {
return $$(() => {
let quantity = 1;
let note = '';
const total = quantity * 12;
$(ui.show('total', total));
$(ui.show('note', note));
ui.add = () => (quantity += 1);
ui.write = (text) => (note = text);
});
}- total
- $12
- 0 runs
- note
- -
- 0 runs
01
No signals. No .value.
State is a let, and an update is an assignment. The compiler rewrites reads and writes.
import { createSignal, createMemo, createEffect } from 'solid-js';
const [count, setCount] = createSignal(0);
const double = createMemo(() => count() * 2);
createEffect(double, (value) => console.log(value));
setCount(count() + 1);import { $$, $ } from 'silmaril';
$$(() => {
let count = 0;
const double = count * 2;
$(console.log(double));
count += 1;
});02
Dependencies found at build time.
The compiler lists which code reads each variable. A write runs that list, with no tracking while your code runs. How it works
import { $$root, $$get, $$set, $$memo, $$effect } from 'silmaril';
const $g0 = [[0], [2], [1]];
export function cart(ui) {
return $$root($g0, ($s) => {
$$set($s, 0, 1);
$$set($s, 1, '');
$$memo($s, 0, 2, () => $$get($s, 0) * 12);
$$effect($s, 1, () => ui.show('total', $$get($s, 2)));
$$effect($s, 2, () => ui.show('note', $$get($s, 1)));
ui.add = () => ($$set($s, 0, $$get($s, 0) + (1)));
ui.write = (text) => ($$set($s, 1, text));
});
}03
A small runtime with no dependencies.
A test fails when the runtime reaches 1.5 kB.
1.42 kB
silmaril minified and gzipped, measured when this site was built.
04
How it compares.
Svelte and Solid render UI. silmaril only does reactivity, and pairs with a UI library through stores.
| silmaril 0.5 | Svelte 5 runes | Solid 2.0 signals | |
|---|---|---|---|
| State | let count = 0 | let count = $state(0) | createSignal(0) |
| Dependencies found | At compile time | At run time | At run time |
| Works in | Any compiled .js or .ts file | .svelte, .svelte.js and .svelte.ts files | Any file |
| Renders UI | No | Yes | Yes |
| Needs a build step | Yes | Yes | No |
Compared in November 2026.
- License
- MIT
- Runtime
- 1.42 kB, no dependencies
- Compiler
- Node.js 22.18 or 24.11+
- Format
- ESM only
- Version
- 0.5, before 1.0