|
|
|
|
|
by eyelidlessness
2120 days ago
|
|
Clojure is a fantastic language, as far as dynamically typed languages go. ClojureScript turned me off to both languages however. I routinely encountered scenarios where accidentally passing values of the wrong type to core standard lib functions produced wildly unexpected behavior that would take hours or even days to debug. Reporting these issues almost always resulted in “don’t do that WONTFIX”, and often very hostile responses if I pressed the issue or even offered to contribute a fix. Ultimately I decided I’d be more productive in a language that embraces correctness as a core feature. And ultimately that led me to take the great FP techniques and philosophy I learnt in clojure and apply them as idiomatically as I could in a statically types language. Now most of my work is in TypeScript, and while I miss a lot of what Clojure has to offer, I would never go back |
|
Could you provide a concrete example?
Intuitively I do understand ClojureScript is not as seamless as some people say. First of all, Clojure is kind of a database-programming language with fundamental data types built around concurrency, while JavaScript was single-threaded until recently (and web workers used shared-nothing model). Second, Clojure is build around Java specifically, not any other language. Java has some strict type system with immutable complex objects being pretty much native way of doing things, thus Java is great for implementing dynamic types on top of it.
But I feel like not having undeniable proofs of fundamental flaw in ClojureScript. For example, JavaScript fundamentally lacks copy-on-write complex structures. Thus development of copy-on-write libraries is painful e.g. ProseMirror which can become completely broken until page reload which is bad for Single Page Application. However, could it be that ClojureScript... just works?