silmaril

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 silmaril
cart.js
import { $$, $ } 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
A cart with a quantity and a gift note. Adding one runs only the code that reads the total. Typing a note runs only the code that reads the note.

01

No signals. No .value.

State is a let, and an update is an assignment. The compiler rewrites reads and writes.

Signals, Solid 2.0count.js
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);
silmarilcount.js
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

cart.js, compiled
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.

One plugin, nine bundlers

  • Vite
  • Rollup
  • Rolldown
  • esbuild
  • webpack
  • Rspack
  • Rsbuild
  • Farm
  • Bun
Bundler setup

04

How it compares.

Svelte and Solid render UI. silmaril only does reactivity, and pairs with a UI library through stores.

silmaril 0.5Svelte 5 runesSolid 2.0 signals
Statelet count = 0let count = $state(0)createSignal(0)
Dependencies foundAt compile timeAt run timeAt run time
Works inAny compiled .js or .ts file.svelte, .svelte.js and .svelte.ts filesAny file
Renders UINoYesYes
Needs a build stepYesYesNo

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

Make your first variable reactive.