3 ms·
Julias AST is very similar to an S-Exp so the macros in that sense have a lot of the same benefits of a lisp macro. However they don't have the same ease since
by zaphar 12y ago
Julias AST is very similar to an S-Exp so the macros in that sense have a lot of the same benefits of a lisp macro.
However they don't have the same ease since the AST does not necessarily match the way the source looks. In Lisp the AST looks exactly like the source so it's easier to visualize what a macro needs to do.
Julia requires you to mentally translate the source code syntax into an AST as an extra step. That extra step doesn't make them any less powerful/flexible though. It just makes them slightly harder to use.
- grayclhn 12y agoOnly loosely related, but I would love to see multiple dispatch come to Julia's macros. I seem to spend a fair bit of each macro switching on the expression's head, and would happily offload that step. (Of course, that might be growing pains since I don't really have a good feel for writing macros in the first place.) Naturally, the best way to make that happen would be for me to write a macro implementing it... :)