Remove v1 macro system - #43
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 itselfstd/macro/Macro.class.laz— the context class passed to handlersstd/macro/Debug.macro.laz— the only shipped macroexamples/TestAnnotation.class.laz— the only example using itparse_macros,is_macro_ahead, allmacro_modifiersattachment points)Module.is_macrofield and.macro.lazfile kind in the linkerExpanderpass loop inMain.build_fileandMain.build_libVerified
make selfhostpasses — compiler rebuilds itself and fixpoint holds.