5 ms·
Clojure is the most productive(and beautiful) language in existence(personal preference) as long as you don't have to leave its world. I stop using it because
by ithrow 6y ago
Clojure is the most productive(and beautiful) language in existence(personal preference) as long as you don't have to leave its world.
I stop using it because the lack of Clojure libraries pushed me to use Java libraries, and that was a life-sucking experience. Java is fine as language but you cannot say the same about the APIs of many of its libraries. I also started sensing that new open source libraries are not being created in Java which worsens the story for Clojure.
- reitzensteinm 6y agoThe other way you have to leave the Clojure ecosystem is when you have to communicate across the network or persist to disk. Writing everything fits in memory data analysis in Clojure is some of the cleanest and most fun programming I've ever done. But once you want to spread between multiple computers or operate on data larger than what comfortably fits in memory, you end up coding just like you would in C#. I started working on some versions of persistent data structures that serialize to a KV store, which lets you send a hash map to another machine, have save that machine add a key, then send it back. It seemed to work pretty well, but there's a ~10x performance penalty over Clojure's inbuilt data types (which are themselves not lighting the world on fire speed wise). That's a pretty harsh price to pay - you can use 100 machines to simulate single address space Clojure on a 10x machine. Awesome, but likely impractical. If you need the persistence between program runs or would like to run incremental computation on large data I could see it working well, though.
- reitzensteinm 6y agoSo this got 3 downvotes, and I don't care about the karma, but I'd be quite curious to hear about opposing experiences scaling up Clojure programs since there seems to be some disagreement. If you started to struggle with fitting everything in one node due to CPU or memory constraints, but still felt like you were writing Clojure in a half way idiomatic style when moving to a cluster, I'd love to hear from you.
- SaxonRobber 6y agoThat’s just what happens around here when you imply that a Lisp might not be perfect. Don’t think to hard about it, they don’t either.
- stonemetal12 6y ago~10X a performance penalty doesn't seem that bad. In C a pointer derefference will beat a web service call by more than 10X. Also why a handjammed KV store? EDN and other(faster) serialization libraries have been around for quite a while.
- reitzensteinm 6y agoI used nippy originally, then later Java serialization libraries once it became clear optimization was required. I tried using both Redis and RocksDB. The happy case had all but the last layer of nodes sitting in cache in memory (as long as your memory is more than 1/32 of the size of your disk). I think I could do better starting from scratch given what I've learned.
- emidln 6y agoWhen I was using HoneySQL[0] speaking to PostgreSQL over JDBC to deal with persisted data, I did not feel non-idiomatic. When I used Kafka and Onyx[1] to process large dataflows, I did not feel non-idiomatic. Granted my working set was only a few 10s of TB, but there wasn't much pain involved. I tended to use Nippy[1] for serialization. I didn't use special data structures (except when the problem called for it), with a clear separation using nippy serialization (in place of pr-str/read-string) at the edges of my app. [0] https://github.com/jkk/honeysql https://github.com/jkk/honeysql [1] http://www.onyxplatform.org/ http://www.onyxplatform.org/ [2] https://github.com/ptaoussanis/nippy https://github.com/ptaoussanis/nippy
- reitzensteinm 6y agoBut did you really get much of the benefit of using Clojure? If you store your data in an SQL database for instance, that layer provides the equivalent of what Clojure's STM can do within the process. You open a transaction, run some queries, perform some logic, then update the database. Clojure's persistent data structures don't give you extra leverage here - you could just as well write the logic with mutable datastructures in C# (that you throw away afterwards). This is no accident, as Clojure's STM was built around the premise of emulating the MVCC provided by databases to provide ACI (minus the D) guarantees to program against. If you're already getting those guarantees elsewhere, doubling up does no good. Similarly, code that operates on streams is generally not where you get bogged down by state and multithreading in something like C#. I say this as somebody that believes Clojure is a powerful addition to the toolbox. I even use refs in production code...
- robto 6y agoI say you still do get a benefit from using because of the repl-driven development process. I miss that instantaneous feedback and the feeling that you are in dialogue with your program whenever I develop in other languages. Add to that the fact that the language shepards you into using immutable datastructures and writing pure code, I still think Clojure is a significant advantage when writing distributed applications.
- emidln 6y ago
- nickbauman 6y agoYeah good point I find myself often having to use a Clojure shim over a not great Java library out there. It's painful at first but it can be really great once you've tamed that beast.
- TurboHaskal 6y agoAlso makes for the best GC benchmark out there.
- smabie 6y agoIf we're talking about Lisps, I've found Racket to be considerably more expressive, and incidentally, more beautiful as well. If we're talking about beauty of any language, I think many would agree that APL takes the cake.
- SaxonRobber 6y agoYes but it isn’t clojure so I have to downvote this. (I can’t actually downvote)
- diggan 6y agoThe great thing about Clojure is that it's not tied to the JVM. JVM is just one of the hosts. So I mostly do frontend development at the time and I know Clojure since before. Because of those two variables, I've chosen to use ClojureScript so now I 99% of my professional time write only ClojureScript, with the remaining time being 1% JS when needed. Otherwise the only time I see JS is when I have to understand how a library works. So I agree with you on the Java side, I'm not a Java developer and I want to stay far away from it, but I love Clojure and I need to be close to it, any other language feels inefficient and slows me down. But there are other hosts you can use, if needed.
- tzjmetron 6y agoUse Common Lisp for a real practical Lisp.
- diggan 6y agoAnd since there is always someone who jumps in saying "Common Lisp is a true lisp while Clojure is not", read https://en.wikipedia.org/wiki/No_true_Scotsman https://en.wikipedia.org/wiki/No_true_Scotsman so we can have a real discussion about the difference ;)
- kazinator 6y ago"No True Scotsman" is about moving the goalposts regarding to the quality or suitability of something. We wouldn't reasonably say that a Dane isn't a True Scotsman, right? A piece of crap unsuitable for production use could be a Lisp. Lisp 1.5 is Lisp; I wouldn't use it today. Lisp or not is not about quality, but semantics. Clojure lacks or changes numerous semantics which define Lisp. That's not statement about quality, just otherness. Clojure doesn't call itself a Lisp; though the main website claims it is a Lisp dialect. Dialects are defined by mutual intelligibility. An Osaka man speaks a dialect which is understood in Tokyo. The mutual intelligibility between Lisp dialects and Clojure does not extend very far beyond (+ 2 2).
- thom 6y agoClojure is a pragmatic language, and I think if you just reject the immense value of being on the JVM and try to treat it as something pure and unsullied then you're missing a lot of its motivation.
- holtalanm 6y agothere are other vms that would provide the same level of value, though, for clojure. the fact that it runs on V8 via ClojureScript is proof of that. personally, I believe they should have used BEAM originally and stayed as far away from the jvm as they could, but that is my own opinion, and everyone has their own opinions.
- bcrosby95 6y agoI don't think there's a world where Rich Hickey would have had it running on BEAM. From what I've read, a large part of why he originally chose the JVM is because companies he wrote software for would be okay with something that runs on the JVM, but not something like Common Lisp. And surely not BEAM. At its core, Clojure attempts to be practical. Running on the JVM was a practical decision.
- thesuperbigfrog 6y agoClojerl (https://github.com/clojerl/clojerl https://github.com/clojerl/clojerl) is a Clojure implementation built on Erlang. I have never used it, but it seems to still be actively developed / maintained.