ludic/selfhost
Orkuncakilkaya a38195128f feat(stdlib): namespaced standard library (issue #2)
Implement the bulk of the namespaced-stdlib proposal (workshopsoft/ludic#2):
156 namespace methods across Math, Text, List, Ease, Collide, World, Net,
Sys, Save, Mem, extended Screen, Color functions, extended Random, and Time.
All deterministic fixed-point; self-hosting (C-free bootstrap fixpoint holds).

Compiler (selfhost/):
- Math.*: sqrt/sin/cos/tan/atan2/asin/acos (fixed-point runtime prelude —
  bit-by-bit isqrt, 256-entry interpolated sine table, Ross atan2), plus
  hypot/dist/dist2/deg_to_rad/rad_to_deg/posmod/wrap/ping_pong/snapped/
  move_toward/smoothstep/lerp/remap/sign/floor/ceil/round.
- Text.* (complete): upper/lower/trim/repeat/pad, split/join/replace,
  and the libc-backed queries.
- List.* (complete): insert/remove_at/remove/sort plus the earlier ops.
- Ease.* (in/out/in_out/back/bounce) and Collide.* (rects/point_rect/
  circles/rect_circle).
- Phase 3: World/Net/Sys/Save namespaced over the bare builtins (byte-
  identical IR) and Mem.* (bytes/words/copy/fill/peek/poke).
- Screen.* extended (line/circle/fill_circle/triangle/fill_triangle via new
  runtime primitives; sprite/sprite_scaled aliases), Color.* functions,
  Random.* (value/int/sign), Time.* (frame/delta/elapsed/now — new
  game-loop frame counter).
- Fix a lexer bug: fixed-point literals with >4 fractional digits overflowed.

Docs & tooling:
- 129 new per-symbol doc pages; gen.py made data-driven (namespaces
  discovered from the docs, no hardcoded list); new check-impl.py enforces
  that every implemented namespace method / keyword / type / phase has a
  doc page, wired into `x test-tools`. Document the previously-undocumented
  keywords (break/continue/where/entry/new/public + and/or/not tokens).
- LSP: namespaced signature help (ns_method_sig) covering every namespace.

Tests: 12 new self-host/regression tests + a golden render for the drawing
primitives. All suites green (selfhost 21, regression 45, tools 29).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-30 00:26:19 +03:00
..
golden feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
tests feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
ast.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
buf.ludic Phase 8b: modern names for the raw-memory and OS/IO primitives 2026-08-28 02:55:24 +03:00
emit_addr.ludic Phase 8a: finish typed indexing — fixeds/ptrs buffers (retire peekf/pokef/peekp/pokep/str_len) 2026-08-28 02:49:40 +03:00
emit_collide.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_color.ludic Language: named colors, namespaced Screen/Input/Random/Map API, named args 2026-08-29 16:05:55 +03:00
emit_colorfn.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_core.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_decl.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_ease.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_ecs.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_expr.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_game.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_head.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_intrin.ludic Phase 8b: modern names for the raw-memory and OS/IO primitives 2026-08-28 02:55:24 +03:00
emit_intrin2.ludic Phase 8b: modern names for the raw-memory and OS/IO primitives 2026-08-28 02:55:24 +03:00
emit_list.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_machine.ludic Language: named colors, namespaced Screen/Input/Random/Map API, named args 2026-08-29 16:05:55 +03:00
emit_math.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_mem.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_net.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
emit_new.ludic Phase 7g: the compiler builds its IR with interpolation, not + 2026-08-28 01:30:37 +03:00
emit_query.ludic Phase 7g: the compiler builds its IR with interpolation, not + 2026-08-28 01:30:37 +03:00
emit_save.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
emit_spawn.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
emit_stmt.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
emit_text.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_time.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
emit_ui.ludic Phase 7i: byte indexing p[i] / p[i] = v (retire peek8/poke8) 2026-08-28 02:01:59 +03:00
io.ludic Phase 7k: bytes(n) / words(n) allocators (retire mem_alloc) 2026-08-28 02:26:15 +03:00
lex.ludic feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
ludicc.seed.ll feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
main.ludic Phase 8b: modern names for the raw-memory and OS/IO primitives 2026-08-28 02:55:24 +03:00
parse.ludic Language: named colors, namespaced Screen/Input/Random/Map API, named args 2026-08-29 16:05:55 +03:00
parse_game.ludic Networking N2–N6, and a fully C-free toolchain 2026-08-29 15:08:23 +03:00
str.ludic Phase 7k: bytes(n) / words(n) allocators (retire mem_alloc) 2026-08-28 02:26:15 +03:00