Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You don't have to parse Perl 6 's grammar ... the parser is written for you.

How it goes ... you add rules for new syntax, and your macro-handler receives a syntax tree. And you transform that into a regular AST that the interpreter can understand ... more or less as in LISP.

The difference is that in LISP you work directly with ASTs ... while in Perl you can access the compiler's pipeline.

This idea is not new ... for instance it's also implemented in Boo (boo.codehaus.org) ... although I don't know how effective is.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: