Examples
Programs that have to keep working.
Every example on this page is compiled and run by CI on each commit. They are not illustrations of what the language might do — they are the acceptance tests that decide whether a change ships.
Language basics
Run any of these with ./build/luke BUILD ../examples/build/<name>.luke -o out && ./out.
-
Printing, bindings, string concatenation, integer arithmetic.
-
Typed parameters and return types, compiled to plain C calls.
-
Structs, constructors, inheritance and
superdispatch. -
Lists and maps, membership, deletion, and the error path.
-
Where arithmetic is exact and how overflow is reported.
-
Importing a sibling file and the standard library in one program.
-
Consuming a package resolved into
luke_modules/. -
Arena allocation and release at scope exit — no collector involved.
Reactive
Fourteen conformance programs pin the engine's behaviour. Each one prints a marker the test suite greps for, so a regression fails the build rather than the demo.
signal price = 100
signal quantity = 3
derived total = price * quantity
print("total=" + total) // total=300
-
Cells, derived values, and recomputation on write.
-
Many writes collapse into a single flush.
-
Deterministic flush order down a dependency chain.
-
Disposal is complete: no live cells and no leaks after scope exit.
-
A failing effect is isolated; neighbours still run, and retries are counted.
-
A dependency cycle is detected and reported rather than spun on.
-
Throughput with median, min and max, run as part of the suite.
-
Staleness, priority, nesting, dedup, subtrees, weak references, scope GC, devtools.
Live Graph
These run as a set: a server watching a SQLite row, a browser client bound to the stream, and an updater that changes the row from outside. The assertion is that the client observes the new value and repaints exactly one region.
-
A row-backed cell pushed over the wire, with resume-from-log.
-
A browser cell bound to that stream, printing its paint count.
-
Incremental view maintenance across a join, recomputed by delta.
-
Incremental aggregates, including ranged and function variants.
-
Time travel over the change log — scrub back and forward.
-
The deployed proof: server, browser client and a Caddy TLS front.
Backend
-
Routes, JSON, SQLite — a small API in one file.
-
Argon2id registration and login, sessions, and the current user.
-
Keep-alive, chunked responses and client IP at ten thousand connections.
-
Pooled statements under concurrent load, measured in the suite.
-
Postgres through libpq with the Slipstream pipelined executor.
-
Bound parameters — the injection attempt stays a string.
Frontend
Browser examples build to WebAssembly plus a generated page. The suite runs them
headlessly through scripts/luke_browser_loader.cjs and asserts on what
painted.
-
Text, buttons, selects, tables and modals, with accessibility wired in.
-
Breakpoints, grids, scroll containers and modal focus traps.
-
A component scope that disposes its subscriptions when destroyed.
-
Keyed list patching — renaming one row does not clear the list.
-
Routing, fetching and forms in a compiled browser application.
-
The smallest possible browser target, for checking your WASI SDK.
Programs that must fail
A language is defined as much by what it rejects. These nine programs are expected to be refused, and CI fails if any of them compiles.
-
Passing a number where the signature declared text.
-
Calling a two-argument function with one argument.
-
Binding a secret into the page — refused by the compiler, not by review.
-
Middleware declared in an order that cannot be safe.