3 ms·
> And "homoiconity" makes absolutely no sense. The source code of every programming language is an AST literal, and in principle every language can have macros
by i_s 11y ago
> And "homoiconity" makes absolutely no sense. The source code of every programming language is an AST literal, and in principle every language can have macros by allowing compile-time AST to AST functions.
It makes perfect sense. Yes, the source code of every language is an AST literal, but it matters a great deal for metaprogramming how close it is to its internal structure.
> The only thing special about Lisp is that the AST is a list, whose operations are familiar to the programmer. With other languages the programmer has to learn some specialized API to write macros. The advantage of Lisp macros is that they are easier to write (than say, Scala macros), but this extra expressing power is enabled by having macros themselves instead of having "homoiconity".
Who are you disagreeing with? I don't think anyone has said macros are impossible in languages other than Lisp.
You are also contradicting yourself here, because "expressive power" and "easier to write" are not independent.