Skip to content

Remove v1 macro system - #43

Merged
NightmarePog merged 1 commit into
mainfrom
remove/v1-macros
Jul 11, 2026
Merged

Remove v1 macro system#43
NightmarePog merged 1 commit into
mainfrom
remove/v1-macros

Conversation

@NightmarePog

Copy link
Copy Markdown
Owner

Closes #42

The v1 macro system is gone. It was too awkward to use in practice — writing a macro meant constructing AST nodes by hand, knowing Lua emission internals, and the whole thing felt more like a workaround than a proper language feature. The only macro that shipped was Debug, and it wasn't worth the complexity.

What's removed

  • compiler/Expander.class.laz — the expansion pass itself
  • std/macro/Macro.class.laz — the context class passed to handlers
  • std/macro/Debug.macro.laz — the only shipped macro
  • examples/TestAnnotation.class.laz — the only example using it
  • Parser support for macro modifiers (parse_macros, is_macro_ahead, all macro_modifiers attachment points)
  • Module.is_macro field and .macro.laz file kind in the linker
  • The Expander pass loop in Main.build_file and Main.build_lib

Verified

make selfhost passes — compiler rebuilds itself and fixpoint holds.

The macro system was too complicated to use and felt more like a hack
than a real language feature. Writing a macro required knowing compiler
internals (AST node construction, Lua emission) and the only shipped
macro was Debug, which most projects didn't need.

Removes Expander, std/macro/Macro, std/macro/Debug, and all parser
support for macro modifiers. Module.is_macro and the .macro.laz file
kind are gone too. Selfhost fixpoint verified.

Closes #42
@NightmarePog
NightmarePog merged commit 9a92ce1 into main Jul 11, 2026
1 check passed
@NightmarePog
NightmarePog deleted the remove/v1-macros branch July 11, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removal of v1 macros

1 participant