3 ms·
Addressing one of your own delusions from above: > Homoiconicity is practically useless So many libraries in Clojure that lead to serious productivity benefit
by hellofunk 9y ago
Addressing one of your own delusions from above:
> Homoiconicity is practically useless
So many libraries in Clojure that lead to serious productivity benefits rely on macros, which in turn are possible because of homoiconicity. It's more than useful, it's a key ingredient in the power of the language. You can extend and embed the language or sub-languages or quickly write a particularly potent DSL in just a few lines of code in Clojure thanks to this feature.
Compare this to language that offer macros but without homoiconicity and the benefits are clear. The two different ways to write macros in C and C++ involve language semantics and syntax that are quite different from the regular syntax. In Clojure, the language is identical, you can actually control the compilation process using the same regular Clojure code that you use everywhere else. It's really quite amazing how far this gets you.
- yogthos 9y agoI also think macros are what keeps the language clean long term. Since most things can be expressed in user space using libraries, you don't have to bolt them onto the core language. As time goes on, usage patterns change and something that might've seemed like a good idea at one time can become an anti-pattern later. Clojure has stayed remarkably small and focused over the years while the way it's used has changed significantly. I wrote about this in more detail here https://yogthos.net/posts/2017-10-03-MovingForwardByLettingGo.html https://yogthos.net/posts/2017-10-03-MovingForwardByLettingG...