From c7b94b2df7ebbaa157c5d0ae5d5c9ac51e9c30d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Apr 2026 18:07:47 +0000 Subject: [PATCH] README: list new language features and examples Updates the feature list to mention structs, enums, for loops, match, inline asm + \`{var}\` substitution, \`poke\`/\`peek\` intrinsics, and the new \`--memory-map\` / \`--call-graph\` diagnostics. Adds the two new examples (structs_enums_for and inline_asm_demo) to the table. https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3 --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6c21c96..39a60fc 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,18 @@ start Main ## Features - **Game-aware syntax** -- states, sprites, palettes, and input are first-class constructs -- **Full type system** -- `u8`, `i8`, `u16`, `bool`, fixed-size arrays (`u8[N]`) +- **Full type system** -- `u8`, `i8`, `u16`, `bool`, fixed-size arrays (`u8[N]`), `enum`, `struct` +- **Rich control flow** -- `if`/`else`, `while`, `for i in 0..N`, `loop`, `match` - **Functions** -- with parameters, return types, `inline` hint, recursion detection -- **State machines** -- `state` with `on enter`, `on exit`, `on frame` handlers -- **Compile-time safety** -- call depth limits, recursion detection, type checking -- **Optimizer** -- constant folding, dead code elimination, strength reduction -- **Multiple mappers** -- NROM, MMC1, UxROM, MMC3 +- **State machines** -- `state` with `on enter`, `on exit`, `on frame`, `on scanline(N)` handlers +- **Compile-time safety** -- call depth limits, recursion detection, type checking, unused-var warnings +- **IR-based optimizer** -- constant folding, dead code elimination, strength reduction, copy propagation, peephole passes +- **Multiple mappers** -- NROM, MMC1, UxROM, MMC3 (including scanline IRQ dispatch) - **Asset pipeline** -- PNG-to-CHR conversion, palette definitions, inline tile data -- **Debug support** -- `--debug` flag, source maps, Mesen-compatible symbol export +- **Inline assembly** -- `asm { ... }` with `{var}` substitution, plus `raw asm { ... }` for verbatim blocks +- **Hardware intrinsics** -- `poke(addr, value)` / `peek(addr)` for direct register access +- **Debug support** -- `--debug` flag, source maps, Mesen-compatible symbol export, `debug.log` / `debug.assert` +- **Compile-time diagnostics** -- `--dump-ir`, `--memory-map`, `--call-graph` flags - **Single binary** -- no dependencies on ca65, Python, or any external tools ## Documentation @@ -70,6 +74,8 @@ start Main | [`state_machine.ne`](examples/state_machine.ne) | State transitions, on enter/exit, timers | | [`sprites_and_palettes.ne`](examples/sprites_and_palettes.ne) | Inline CHR data, palettes, scroll, type casting | | [`mmc1_banked.ne`](examples/mmc1_banked.ne) | MMC1 mapper, bank declarations, multiply | +| [`structs_enums_for.ne`](examples/structs_enums_for.ne) | Structs, enums, `for` loops, struct literals | +| [`inline_asm_demo.ne`](examples/inline_asm_demo.ne) | Inline asm with `{var}` substitution, `poke`/`peek` | ## Compiler Commands