4 ms·
What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits
by wry_discontent 9y ago
What're you using it for? I really like the language, but it seems geared to replace Java for heavy enterprise enterprise applications. A lot of the benefits I hear people talk about sound like they require a large project to be properly noticed.
I've used Clojurescript for a couple toy projects, but it seems awkward to me.
- manishsharan 9y agoI am using it to implement REST services using the Luminus library.
- swlkr 9y agoClojure is great for any size web app, but I will agree here, I found clojurescript awkward as well.
- TheSmoke 9y agoif you could elaborate on awkward part, i'd love to give you a hand. i have 1 react native app built with cljs and 1 chrome extension. using cljs is the best technical decision i've ever made.
- wry_discontent 9y agoI'm still a n00b, but I found the errors to be obscure. Often times, I couldn't even get an error to display when I _knew_ something was wrong. After I fixed that error, the app would show up again. For the most part, everything was incredible while it worked, but every so often very technical errors would come up and that makes me hesitate to advocate for its use at my job.
- didibus 9y agoClojure is good for everything you'd use Java for. So pretty much anything that's going to be long running, like services, or big apps meant to be open for a while. Yes, that fits the enterprise use case perfectly. A backend for any service oriented architecture, ETL jobs, data processing pipelines, backend for websites, rest/rpc/graphql services, client/server applications, big data analysis, machine learning, etc. Clojure is not good for quick scripts, use bash, python, perl, hy, clojurescript, etc. for that. Clojure is not good for low level code, like drivers, embedded systems, os, etc. Use rust, c, c++, D, etc. instead. Clojure isn't good for squeezing every ounce of power out of hardware, such as games, use C++, assembly, etc. for that. Clojure isn't good for mobile app development, use Java, swift, c#, objective-c, etc. for that. Clojure isn't good as an embedded scripting language, use LUA, python, javascript, tcl, scheme, etc. instead for that. Therefore Clojure competes mostly against Java, Scala, C#, F#, GO, NIM, Haskell, etc. Now as an astute reader, you've noticed how none of the competing languages I've listed are dynamic or of the lisp family. This makes Clojure unique in its space and the most controversial.
- zurn 9y agoI think Clojure fits well to quick scripts and exploraory programming, because of the rapid turnaround in interactive development. The finished tool, if compiled, will start fast enough (~1 second for hello world) even though it loses a bit to Python scripts. Clojure also lets you drop down to the most basic JVM primitives, like unboxed types and atomics/volatile, so you can do lower level stuff than in other dynamic languages. You can even follow the asm code generated by the JIT. Combined with macros and other DSL building capabilities, I'd say doing low level or performance oriented work can be pretty productive with Clojure. DSL building blocks and dynamic nature also make it a pretty good embedded scripting language. Many embedded systems are plenty powerful enough to run Clojure (or Python or Java), so it works there too.
- didibus 9y agoWhat you say is true, yet false. While you can use Clojure for script, or performance heavy tasks, or embedded systems, I think it's pretty obvious it's not the right tool for those, at least not yet. If you want to mess around with scripts, performance heavy tasks or embedded systems, sure you can use Clojure, but if you are serious about any of them, it wouldn't make sense. You'd turn to languages that are better suited.
- zurn 9y agoI don't think you addressed any of the arguments here, so quite far from obvious...?
- didibus 9y agoOk, well, for scripts: - You mention sub second load times. Based on https://dev.clojure.org/display/design/Improving+Clojure+Start+Time https://dev.clojure.org/display/design/Improving+Clojure+Sta..., the surveyed timings are around 2 to 5 seconds, going to 60 seconds for some. That's a bit too much for scripts, you can live with it, but users are going to be annoyed about it for sure. - Another issue is the difficulty in starting them. You need to invoke java with a class path setup. So you can't have self executing scripts. You can use inlein, but that brings us to my third point. - The bigget issue is that Java and Clojure are not standard on any machine. While python and bash tend to be. To use Clojure for scripts require each machine to be imaged with java, Clojure and inlein setup. About performance and low level tasks. I'm not sure which of my use case you're specifically talking about. But an OS and drivers need to be compiled to specific hardware, so Clojure isn't an option for low level code like that. Now the JVM isn't performant enough for major games, you can't control memory yourself, or target specific CPU instructions. Finally, only a minority of embeded chips support running a JVM instance, I'm not sure I need to explain any further, if you work in embedded systems, it just doesn't make sense to restrict yourself only to the more powerful chip that can run an embedded JVM. P.S.: I love Clojure, I wish it was great at all these use cases, but it currently isn't, and I think we do the community a diservice to make people believe it is, because they'll try it, and have a subpar experience, leaving them feeling like Clojure isn't that great afterall. I'd rather people try it for what it's good at.