5 ms·
Any language adopting s-expr would instantly be called a Lisp. Arguably, the s-expr syntax is what enables the rich code-as-data metaprogramming that you find
by yvdriess 8y ago
Any language adopting s-expr would instantly be called a Lisp.
Arguably, the s-expr syntax is what enables the rich code-as-data metaprogramming that you find in Lisps. Working with full macros in a sexpr language is already complex enough, the an extra layer of complexity that non-sexpr language add really breaks that camel in half. The point is, you really need code == AST parity to make a powerful macro system workable. You don't necessarily need the parans, but complaining about parens is really missing the point.
- pathsjs 8y agoAs it turns out, you can have a powerful macro system without s-expr syntax (e.g. Scala, Nim). In any case, you jus need to write functions that operate over trees, which you can do in any language. That this tree is not immediately reflected in the actual syntax is just a minor hindrance
- yvdriess 8y agoWriting non-trivial macros in Scala or Nim will quickly liberate you of this notion.
- KingMob 8y agoPersonally, I find homoiconicity is key to easy construction of macros, and to do that, you need s-exprs (or something similar). Without that, it's certainly doable, but the result looks nothing like your non-macro code in that language.