3 ms·
> Nim supports direct access to the AST so macros can be used to define new programming constructs like in Lisp. Nim macros can't modify Nim's syntax. That co
by raiph 12y ago
> Nim supports direct access to the AST so macros can be used to define new programming constructs like in Lisp.
Nim macros can't modify Nim's syntax.
That constraint makes perfect sense for Nim but not Perl 6.
> ANTLR
ANTLR has switched from LL(star) parsing to what they call Adaptive LL(star) for v4. P6 Rules have been what Larry has called "LL(star) with kludges" (by which he means the same thing) for about a decade. So ANTLR has caught up with that aspect and indeed ANTLR v4 is nice tech.
But P6 Rules are built in to P6. Its grammar is defined in P6 Rules. User code can modify the language on the fly by modifying the rules. Java (or whatever) + ANTLR is nothing like Perl 6 and Perl 6 Rules.
- progman 12y ago> Nim macros can't modify Nim's syntax. Nim macros can extend Nim's syntax (additional "repeat ... until" for instance). They cannot change the built-in syntax of Nim. A macro system should never be allowed to change the core syntax of a language because that could lead to very strange errors. If Perl 6 is actually able to do that then it is a dangerous feature.