ludic/selfhost
Orkuncakilkaya 70ab79a4e9 Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null)
`null` is now a real pointer literal and null-tests are comparisons, instead of
`ptr_null()` and `ptr_is_null(x)`:

  ptr_null()          -> null
  ptr_is_null(x)      -> (x == null)
  not ptr_is_null(x)  -> (x != null)

Mechanics: a new E_NULL primary (`null`, like true/false) lowers to the `null`
pointer; emit_bin's comparison path now picks `ptr` vs `i32` from operand type
(via llty), so `==`/`!=` work on any pointer/record/slice. The two intrinsics are
deleted.

Two reseeds: (A) add the literal + ptr comparison keeping the intrinsics; (B)
migrate all 182 call sites (compiler + runtime, via a balanced-paren script that
skips string-literal args and rewrites `not ptr_is_null` to `!= null`) and delete
the intrinsics. Node/Val/Buf/Tok field defaults now read `ptr = null`.

Vocabulary drops the two from LUDIC_INTRINSICS; `null` joins true/false as a
language constant (grammar + ludic_syntax.h). LANGUAGE.md notes the literal.
Reseeded (21664 lines); C-free fixpoint holds; goldens identical; 17/17; vocab +
doc-fences clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-28 00:50:21 +03:00
..
golden Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
tests Phase 7a: bitwise operators & | ^ << >> ~ (retire band/bor/shl/…) 2026-08-28 00:45:10 +03:00
ast.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
bootstrap-cfree.sh Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
bootstrap.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
buf.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
build.sh Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
compile.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
emit_addr.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_core.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_decl.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_ecs.ludic Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
emit_expr.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_game.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_head.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_intrin.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_intrin2.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_machine.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_math.ludic Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
emit_new.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_query.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_save.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_spawn.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_stmt.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
emit_ui.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
game-build.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
io.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
lex.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
ludicc.seed.ll Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
main.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
parse.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
parse_game.ludic Phase 7b: null literal + x == null (retire ptr_null/ptr_is_null) 2026-08-28 00:50:21 +03:00
reseed.sh Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
str.ludic Phase 6f: let = immutable, var = mutable (binding-only) 2026-08-27 23:52:59 +03:00
test.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00