Skip to content

Releases: EdwardJoke/m4

v0.2.2-rc1

02 Jun 09:58

Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[v0.2.2-rc1] - 2026-06-02

Added

  • -h / --help flag — shows CLI help (was missing, now works everywhere) (M1)
  • lint - stdin support — pipe source directly to type-checker: echo 'let x = 1' | m4 lint - (M1)
  • use fs module — file system operations: fs.read(path), fs.write(path, data), fs.exists(path), fs.delete(path) (S1)
  • use str module — string utilities: str.len(s), str.slice(s, start, end) (C1)
  • skills/m4-coder/SKILL.md — AI agent reference for writing correct m4 code (M5)
  • Error codes r012 (Division by Zero) and r013 (Modulo by Zero)

Fixed

  • Zig stack traces suppressed in CLI error output — users now see clean messages instead of internal file:line traces (M1)
  • Division by zero returns Runtime error [r012]: division by zero instead of crashing with Zig panic (M1)
  • Modulo by zero returns Runtime error [r013]: modulo by zero instead of crashing with Zig panic (M1)
  • fsRead now validates ftell return value before casting to usize — prevents crash on unseekable files

Changed

  • m4 explain exits cleanly without stack trace when called with no error code (M1)
  • CLI help: --target flag deduplicated (was -target, --target), build flags integrated into flags section (C2)
  • ROADMAP.md removed — self-hosting compiler plan condensed into AGENTS.md "Future Roadmap" section (M3)
  • AGENTS.md, README, build.zig.zon bumped to v0.2.2-rc1 (M2)
  • SPEC.md bumped to Draft v0.2.2, module list updated with str entry
  • README synced with current CLI help output and stdlib module list (wsp-sync)

Removed

  • ROADMAP.md — 312-line standalone file, key content absorbed into AGENTS.md (M3)

Generated by Relote

Full Changelog: v0.2.1...v0.2.2-rc1

v0.2.1

01 Jun 09:46

Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[v0.2.1] - 2026-06-01

Added

  • lint subcommand replacing --check flag — m4 lint <file.m4> parses and type-checks without execution (M1)
  • m4 <command> help [--zon|--json|--yaml] pattern for command-specific help on all subcommands (lint, build, explain, version)

Changed

  • O(1) variable resolution in compiler via Locals wrapper (ArrayList + StringHashMap), replacing O(n) linear scans in ident and assign-target lookups
  • QBE emitter fmt() now writes directly to output buffer instead of allocating and freeing an intermediate string per line
  • QBE string collection uses getOrPut() single hash lookup instead of contains() + put() double lookup

Fixed

  • m4 build --target cross-compilation now correctly passes target architecture to assembler (-arch) and compiler/linker (-target triple). arm64_apple ↔ amd64_apple cross-compilation verified.
  • Native compilation on non-macOS platforms restored — assembler step falls back to plain as without -arch for native non-Apple targets
  • buildSubcommandHelpInfo returns empty subcommands list for unrecognized names instead of silently returning full help

Removed

  • --check global flag — replaced by lint subcommand

Generated by Relote

Full Changelog: v0.1.2...v0.2.1

v0.2.0-rc2

30 May 09:12

Choose a tag to compare

v0.2.0-rc2 Pre-release
Pre-release

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[v0.2.0-rc2] - 2026-05-30

Added

  • m4 help subcommand with structured output support (--zon, --json, --yaml)
  • m4 version subcommand with structured output support (--zon, --json, --yaml)
  • src/cli_info.zig — serializable CLI metadata types (FlagInfo, SubcommandInfo,
    UsageMode, HelpInfo, VersionInfo) for structured help/version output
  • buildHelpInfo() generates full CLI metadata (subcommands, flags, usage modes)
  • runHelp() and runVersion() handlers for subcommand execution

Changed

  • --help/-h and --version/-v flags replaced by m4 help and m4 version
    subcommands with optional structured output formatting
  • Help text reorganized with explicit Commands section listing all subcommands
    (help, version, build, explain) and their flags
  • REPL welcome text shortened to :h help, :q quit

Removed

  • -h, --help flag — use m4 help instead
  • -v, --version flag — use m4 version instead

Generated by Relote

Full Changelog: v0.1.2...v0.2.0-rc2

v0.1.2

26 May 09:54

Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[v0.1.2] - 2026-05-26

Added

  • Benchmark suite for measuring compiler and VM performance
  • async language feature support
  • Error codes explainer with AI-friendly output formats

Changed

  • Renamed language from "maple" to "m4" with corresponding .m4 file extension
  • Updated build.zig.zon dependency fingerprint for the renamed package
  • Compiler optimizations for faster compilation times

Generated by Relote

Full Changelog: v0.1.1...v0.1.2

v0.1.0

24 May 11:46

Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[v0.1.0] - 2026-05-24

Added

  • Core language types: tokens, AST, runtime values (nil, bool, int, float, string,
    fn, vec, char), heap objects, bytecode opcodes, and type system
  • Hand-written scanner with indentation tracking and recursive-descent Pratt parser
    with structured error collection (text + DiagnosticList)
  • Single-pass bytecode compiler, type checker with scope chain environments, and
    register-based VM with call frames and native function dispatch
  • Standard library with print/println native functions
  • AST pretty-printer for canonical formatting
  • Bytecode disassembler for debugging
  • Structured error module with multi-format output (ZON, JSON, YAML)
  • CLI entry point with REPL, source file execution, pipeline orchestration,
    --debug, --check, --format, and --error-format flags
  • Module root re-exporting all public declarations for library consumers

Chores

  • Project scaffolding with build.zig, Zig 0.16.0 minimum, and serde dependency

Generated by Relote