feat(cli): install in one command, and call the CLI ludic

Getting started meant cloning the repository, bootstrapping a compiler and
learning a task runner called `x`. That is a contributor's workflow handed to
everyone who wants to try the language.

Installing is now one command:

    curl -fsSL https://workshopsoft.pages.workshopsoft.io/ludic/install.sh | sh

install.sh puts a complete toolchain — compiler, CLI, engine runtime, bundled
ludic.* packages, formatter, language server — in ~/.ludic and adds it to PATH.
Prebuilt artifacts are checksum-verified; where a platform has none, or the
release predates this layout, it bootstraps from the compiler's own IR seed with
clang. The docs site publishes the script beside the pages that quote it, so the
page and the script can never come from different releases.

`x` becomes `ludic`, and the surface splits by audience. A user of the language
sees `new`, `run`, `build`, `test`, `add`, `fmt`, `lsp`, `doctor`, `upgrade`;
`ludic new` scaffolds a project that builds and plays as it stands. Everything
the toolchain repo needs moved under `ludic dev` — build, test, reseed,
bootstrap-cfree, docs-gen, release — unchanged apart from the namespace. Those
tasks read arguments one position further along, so dispatch_dev sets a shift
and commands use arg_n()/arg_total() rather than each knowing its own depth.

Release artifacts become complete install roots (bin/ beside runtime/, packages/
and VERSION) rather than bare binaries, which is what the installer unpacks.
`ludic dev test` asserts the whole shape: it stages an install, puts it on PATH
with no LUDIC_HOME, and runs new -> build -> test through it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-05 22:01:52 +03:00
parent 005cc39394
commit aca263642d
54 changed files with 1802 additions and 670 deletions

View file

@ -1,14 +1,14 @@
# Examples
A curated tour of Ludic, grouped by intent. Every example here is exercised by
the test suite (`bin/x test` / `bin/x selfhost-test`), so nothing in this
the test suite (`bin/ludic dev test` / `bin/ludic dev selfhost-test`), so nothing in this
directory silently rots.
Run any program straight from the repository root (so `assets/` resolves):
```sh
bin/x app examples/games/snake.ludic # compile + open a real window
bin/x app examples/games/snake.ludic --headless # render one frame to build/out.ppm
bin/ludic build examples/games/snake.ludic # compile + open a real window
bin/ludic build examples/games/snake.ludic --headless # render one frame to build/out.ppm
bin/ludic examples/lang/offline_rewards.ludic # compile + run a plain program
```

View file

@ -1,6 +1,6 @@
# ============================================================================
# snake.ludic — a small, complete game in Ludic. No sprites or assets: every
# pixel is drawn from primitives. Build: bin/x app examples/games/snake.ludic
# pixel is drawn from primitives. Build: bin/ludic build examples/games/snake.ludic
#
# It shows the everyday shape of a Ludic game: an ECS for the moving parts (one
# entity per snake segment), named program state for the rest, and a Render

View file

@ -11,7 +11,7 @@
# 25 @OnDetach(Shield): reads the outgoing amount 5, prints 5 + 20
# 0 the Shield is gone — nothing matches
#
# bin/x game-build bin/ludicc examples/lang/detach.ludic /tmp/detach
# bin/ludic dev game-build bin/ludicc examples/lang/detach.ludic /tmp/detach
# /tmp/detach </dev/null
program Detach {
property Tag { v: int = 0 }

View file

@ -9,7 +9,7 @@
# 503 Enemy A despawned in-world (Despawned): drop its loot, 3 + 500
# 1009 Enemy B outlived the run; at quit (Quit) it skips loot, 9 + 1000
#
# bin/x game-build bin/ludicc examples/lang/reason.ludic /tmp/reason
# bin/ludic dev game-build bin/ludicc examples/lang/reason.ludic /tmp/reason
# /tmp/reason </dev/null
program Reasons {
property Health { hp: int = 0 }

View file

@ -12,7 +12,7 @@
# 201 900 frame 3: Play.World.Step, then Hud.Draw
# 202 900 frame 4: Step reaches 2 -> quit(); Hud.Draw paints the last frame
#
# bin/x game-build bin/ludicc examples/lang/scenes.ludic /tmp/scenes
# bin/ludic dev game-build bin/ludicc examples/lang/scenes.ludic /tmp/scenes
# printf 'aaaa' | /tmp/scenes
program SceneDemo {
var counter: int = 0

View file

@ -1,6 +1,6 @@
# coverage.ludic — a spec built to be measured by `bin/x test --coverage` (issue
# coverage.ludic — a spec built to be measured by `bin/ludic dev test --coverage` (issue
# #45). Compiled with `--coverage`, every statement bumps a per-source-line hit
# counter; at exit the counts are dumped and `bin/x test --coverage` turns them
# counter; at exit the counts are dumped and `bin/ludic dev test --coverage` turns them
# into a per-file line-coverage report.
#
# The tests below exercise `sign` fully but only the taken branches of `grade`,

View file

@ -14,7 +14,7 @@
# 5. rt_receive() — the client reconciles to the authoritative x=5
#
# Prints 5 / 999 / 5. Build & run with the Ludic toolchain only:
# bin/x app examples/networking/net_demo.ludic --headless && ./build/net_demo_headless
# bin/ludic build examples/networking/net_demo.ludic --headless && ./build/net_demo_headless
import "net_rt.ludic"
program NetDemo {