2 ms·
This is a slightly expanded answer to your question, apologies for the external link, I could of course repeat here verbatim, but let's not increase entropy nee
by iLemming 2y ago
This is a slightly expanded answer to your question, apologies for the external link, I could of course repeat here verbatim, but let's not increase entropy needlessly, right?
https://www.reddit.com/r/Clojure/comments/1dyjwyo/is_it_easier_to_write_oneliners_in_clojure_than/lclna76/ https://www.reddit.com/r/Clojure/comments/1dyjwyo/is_it_easi...
Beware though, that there are today more than one flavor of Clojurescript, nbb for instance still acts just like JS in this regard.
- tombert 2y agoThis is exactly what I wanted...thanks! The last time I did ClojureScript in serious capacity was for a school project in 2021, specifically because I wanted to play with re-frame and the people who designed the project made the mistake of saying I could use "whatever language I want". It makes sense, but I guess I didn't realize that ClojureScript generates some nice runtime wrappers to ensure correctness (or to at least minimize incorrectness). I guess that means that if you need to do any kind of CPU-intensive stuff, ClojureScript will be a bit slower than TypeScript or JavaScript, right? In your example, you're adding an extra "if" statement to do the type check. Not that it's a good idea to use JS or TypeScript for anything CPU-heavy anyway...
- iLemming 2y ago> ClojureScript will be a bit slower than TypeScript or JavaScript, right? In rare cases, sure, it can add some overhead, and might not be suitable I dunno for game engines, etc., but in most use-cases it's absolutely negligible and brings enormous advantages otherwise. Besides, there are some types of applications that simply really difficult to build with more "traditional" approach, watch this talk, I promise, it's some jaw-dropping stuff: SpreadSheesh! talk by Dennis Heihoff https://www.youtube.com/watch?v=nEt06LLQaBY https://www.youtube.com/watch?v=nEt06LLQaBY