Tags: anderix/lux
Tags
Release v0.10.1: unterminated strings point at the opening line A string missing its closing quote used to treat the newline as an ordinary character, so the lexer swallowed the rest of the file until it found the next quote, folded everything between into one string, and then tripped on the leftover far below — reporting an error nowhere near the real mistake. My son hit exactly this: a missing quote on one line surfaced as an "unexpected character" complaint about an apostrophe a hundred lines down. The string scanner now stops at a newline and reports an unterminated string at the opening quote, where the missing " belongs, with a note that a string closes on the line it opens. This also settles that lux strings are single-line, which the \n escape already implied. No valid program changes; add two lexer regression tests (the first in the tree). Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.8.3: magic input and number hand back a value you can keep `lux magic input` and `lux magic number` now wrap the read in a small helper (`ask` returns a plain string, `askNumber` a plain int, each with a default when the input ends or doesn't parse), so the answer lands in a variable you can use anywhere instead of dying inside the match arm — the scope wall a beginner hits the moment they try to use what they read. Also polishes `lux learn` prose: a duplicated sentence and typos in the strings and functions cards, and an over-used "honest" pared back to where it earns its place. Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.8.2: lux magic run, the capstone spell lux magic gains a seventh spell, run: launch another program and read back what it said. It runs further ahead of the learn ladder than the others — its trail is four topics (result, match, structs, shell) — and that is deliberate. The moment a player realizes their own lux program can drive a real command is a payoff worth reaching for before all the ideas underneath are in place; the trail home is honest about where each one is explained. Like every spell it already works, runs under empty input, and translates to all three backends. Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.8.1: three more lux magic spells and a Go backend fix lux magic gains three spells answering the questions a player hits next after the listening trio: list (carry more than one thing), save (keep something so it's there next time), and args (read what's typed after the file name). Each is real lux the suite runs and translates, and each ends with a trail back into lux learn. Writing save surfaced a Go-backend bug: an err(let _) or some(let _) match arm emitted `_ := err.Error()` or `_ := *ptr`, which Go rejects with "no new variables on left side of :=". The backend now skips the binding when it is `_`, since the error or pointer is already consumed by the `== nil` test. This also clears the same two errors from examples/keep.lux's Go output. Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.8.0: total conversions, parse builtins, and lux magic
Two milestones ship together.
Conversions vs parsing. int, float, and string are now total conversions
that cannot fail; they no longer parse strings. Reading a number out of
text — which can fail — moves to two new builtins, parseInt and parseFloat,
each returning an Option the reader already knows how to match. int("5") had
been the one operation in lux that could fail by aborting the program, a
quiet contradiction of the no-hidden-failures rule the language teaches
everywhere else; that string case now errors with a trail to parseInt. The
change also removes a latent Go-backend bug, where int(aString) had emitted
invalid Go. A new lux learn conversions topic draws the line, and a shipped
examples/conversions.lux exercises the whole surface across all three
backends.
lux magic. A task-indexed companion to lux learn: spells for things you want
to do now. A spell is a small program that already works, ending with a
trail to the lux learn topics that explain it — a working shape for a reader
still climbing the ladder, honest about where the trick is explained. The
first three answer the question a player hits the moment they want their
world to listen: read a line, read a number (on the new parseInt), and a
read-a-command loop. The crawl's chamber now points at lux magic input, so
the bridge sits exactly where the wish to build appears. Every spell is real
lux the suite runs (terminating under empty input) and translates.
The name lux magic was my son's idea, and it was the right one.
Written by David M. Anderson with AI assistance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.7.2 First playtest fixes for The Little Keep: the help columns get headings so descriptions aren't read as commands, the cellar's two exits (west and down) are split so they don't blur into one, and the vault names the steps that lead back up. Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Release v0.7.1 The crawl polish: the secret is earned in the chamber and saved to disk as a keepsake (read-then-write file I/O), a hidden `take gold` in the vault, a `cd`-first scaffold summary, aligned help, and the corrected `world.lux` header path. Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add `lux crawl`: a text adventure you play by running and build by ed… …iting `lux crawl` scaffolds a small text adventure into the current directory whose whole world is one lux file. The rooms are an enum, where you stand and what you carry is a struct, and a turn is a function that takes the world and your command and returns the next one — nothing is hidden in an engine. You play it by running it and change it by editing it, the first step from using a program to building one. Running it over a crawl you already started reports where it is rather than overwriting your changes. The scaffolded world is examples/keep.lux, "The Little Keep," embedded with include_str! so the copy you play and the corpus the tests run can never drift. A brass key behind a locked door teaches Option; a torch that lights a dark vault teaches arrays, through an inventory that grows with +=. A new `lux learn crawl` topic and a `build` lesson walk through how a world is put together, with the world-in/world-out idea on the more page. The world is the first lux program rich enough to flush out latent transpiler gaps. This fixes the footgun: a lux name that is a keyword in a target language (`go`, `where`, `map`) now gets a trailing underscore in that backend only, at value positions, so the program still compiles; a payload-less enum case also parenthesises in Go so `room == Room.hall` no longer trips its block-vs-literal parse. The remaining seams — Go's Option-of-enum and empty-array typing, Rust's value-after-move — are left as honest boundaries and documented in learn-lux.md's scope notes rather than worked around, so the rich world runs under the interpreter and stays out of the transpile suite on purpose. Written by David M. Anderson with AI assistance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PreviousNext