← Back to context

Comment by sundarurfriend

4 years ago

Yeah, Julia can only take metaprogramming so far given its non-S-expr syntax - which is the right tradeoff given its domain. Its macros have to be given at least vaguely Julia-like syntax - `*` still needs to be a binary operator, `if`s need `end`s, etc. That's great for nice little DSLs appropriate for the scientific domain, but not quite enough for a "platform for programming languages". (It also has "string macros", which can accept anything at all, but basically give you a lump of string at compile time, and leave the tokenization, parsing, and any further manipulation up to your macro.)

> Its macros have to be given at least vaguely Julia-like syntax

That’s true with Lisp as well. The point of homoiconicity is that your DSL looks like your parent language.

That said, Julia supports string macros. See for example “APL.jl” for a macro of to compile APL to Julia.