Once a programming language exposes a Turing complete macro system, the need arises for a Smalltalk-like meta-object protocol so that nested macros can negotiate with each other and the compiler itself. This is where things get tricky.
Even with macros being functions from syntax to syntax, they often need to interact locally with the compiler as they're running, for example to determine the scope of a name, or the type of a declared variable. Especially in an open world context.
-
-
but if macros already depend on partial evaluation, that completely distorts what macros are supposed to be; all they are supposed to do is to extend syntax - all introspective work should be handed off to templates.
-
perhaps i'm a bit old-fashioned for insisting on distinct bauhaus-style translation stages, i don't know. i fear the potential for an organic mess that produces constant misunderstandings and edge cases.
- 15 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.