by hellofunk · 9y ago · 0 comments
> 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.
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-MovingForwardByLettingG...