4 ms·
Nim and Scala are not homoiconic, yet they both have true macros
by pathsjs 9y ago
Nim and Scala are not homoiconic, yet they both have true macros
- e12e 9y agoDylan?
- pmarreck 9y agoAfter reviewing Dylan's, it doesn't seem as powerful. And it's unclear how it handles runtime variables passed within code snippets to macros (Elixir has "unquote" for this)
- pmarreck 9y agoNim's macros look harder to use, with a fairly custom DSL in the AST (instead of, say, a simple datastructure like a nested map). I don't think you can pattern-match on AST fragments, either, like you can in Elixir. Scala macros cannot change its syntax, Elixir macros can I believe (to some extent).
- pathsjs 9y agoThe AST of Nim is a simple tree, the only thing is that the nodes of this tree are tagged with a kind that represents the kind of syntactic element, since the language is not homoiconic