Comment by freemint
4 years ago
The metaprogramming capabilities seems quiet similar to Julia's, I wonder how they will differ by the end.
4 years ago
The metaprogramming capabilities seems quiet similar to Julia's, I wonder how they will differ by the end.
Racket's programmability goes far beyond Julia's. Racket is really a platform for programming languages rather than being primarily a programming language. For an example of what this looks like in practice, check out Rosette, a programming language in Racket which completely changes the semantics to work transparently with tooling like Z3.
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.