4 ms·
I've also came upon Clojure after investing much time in Lua/Love2d, but my takeaways are different from yours. I enjoyed Lua's simplicity, portability and exe
by jmiskovic 7y ago
I've also came upon Clojure after investing much time in Lua/Love2d, but my takeaways are different from yours.
I enjoyed Lua's simplicity, portability and execution speed. It shares much of JS strengths, with fewer quirks. I was productive after a weekend of reading Programming in Lua book.
Clojure took some more time because I had to unlearn some habits. It's for the best, I think. It's not just about homoiconicity and REPL. In Clojure it's hard to do the wrong thing, compared to JS or Lua. The language makes it easy to isolate a small piece of functionality, develop and test it, and then and put it together into coherent whole. Clojure may be harder to learn, but the cognitive load is smaller and it scales better for large projects.
Persistent data structures are also huge step forward. They eliminate whole class of errors and allow for traceability and reproducibility.
As for s-expressions, yes, they can be a nuisance in editor without proper support. I'm getting by with SublimeText + zprint auto-formater. For REPL I found no better than Atom's proto-repl. Also I hated Lua's "if..then..else..end" and other verbose constructs. I'd say s-expressions are more consistent and compose better. Still, your frustration is familiar to me.
- sdegutis 7y ago> "Clojure took some more time because I had to unlearn some habits. [...] In Clojure it's hard to do the wrong thing, compared to JS or Lua." I've seen and even written a lot of really really awful Clojure code which technically fits the criteria for good code, on paper, but completely misses the bigger picture. (People have made the same argument for Go, that it's idiot-proof, but I've seen plenty of awful Go code too.) I'm more and more convinced that bad programmers will write bad code in any language and good programmers will write good code in any language.
- frou_dh 7y agoThanks for making me aware of zprint. Cool that they distribute an AOT compiled binary, too! BTW, for Sublime, you could install the Terminus package to get an integrated terminal to run clj(1) in. Then with a few lines of Python, you could write a command to send text from the editor side to the REPL side. (I have a half-baked enhanced Clojure package with some features in this vein, but it's not public atm)
- NikkiA 7y agoHave you seen/tried fennel[1] or Urn[2] ? [1] https://github.com/bakpakin/Fennel https://github.com/bakpakin/Fennel [2] https://urn-lang.com/ https://urn-lang.com/
- jmiskovic 7y agoI've evaluated both (and also lumen) briefly. I disliked the half-way approach that doesn't isolate Lua's messy state handling from lisp model. Clojure also interacts with Java, but it feels like CLojure is the host that runs Java methods as needed. The separation is clean and you know exactly when you are crossing the boundary into stateful territory. I see the value of those languages for lispers wanting to script the platforms where Lua can run, but not really as a core language for modelling your domain.