28 ms·
Clojure does all three: 1) Native, compiled binaries with GraalVM. 2) ClojureScript (already mentioned) for the browser. 3) For ML, Clojure in the last 2-3 y
by erichocean 3y ago
Clojure does all three:
1) Native, compiled binaries with GraalVM.
2) ClojureScript (already mentioned) for the browser.
3) For ML, Clojure in the last 2-3 years has built a really great internal ecosystem but it hardly matters because libpython-clj exists so you can run NumPy, PyTorth, etc. from Clojure. Getting data in and out of Python land is just as easy as Java-interop. The reverse also works (calling out to Clojure from an arbitrary Python interpreter).
Plus a few other things you didn't mention:
4) ClojErl is Clojure on BEAM. You have full access to Erlang libraries (e.g OTP) and 98% of Clojure, missing only things that don't make sense on BEAM.
5) Write native iOS/Android apps with either React Native or Flutter (via ClojureDart). Develop them interactively just like you do browser stuff with ClojureScript.
6) Clojure now makes a great scripting platform with Babushka, which has completed replaced Node.js/Python/Bash for that use case for me.
6) Datomic/Datalog, there's still nothing like it after 10 years and in the last two weeks, it's Apache 2-licensed free to use and deploy.
Elixir/Erlang are really impressive, but being BEAM-only is a serious limitation. Clojure is a bit more practical (and I still get to run Clojure-on-BEAM when that makes sense).
- pmarreck 3y agoHow did they make Babashka (it’s apparently spelled that way) instantly start? Do they pre-warm a Java thread in the background? Do math errors still dump Java stack traces in Clojure? That and the lack of syntax once ruled it out for me.
- stefcoetzee 3y agoBabashka runs on GraalVM, as opposed to the usual JVM. I understand the frustration with Clojure errors, but am surprised that a lack of syntax would rule a programming language out.
- pmarreck 3y agoI don't know of a rational basis for this other than simply being more comfortable with more syntax and fewer parentheses to trace visually. I did take a class in Scheme once so I'm not completely unfamiliar with coding in a Lisplike.
- ravi-delia 3y agoYeah, taste is taste. I do get it- it's why I like Clojure's syntax more than CLs, but man I don't get commas. Or even Elixir, I love the language but its always painful to come back to the syntax. Pipe operator aside, that is.
- pmarreck 3y agoSpeaking of the pipe operator, do Lisplikes have anything like that, or like pattern-matching, or complex value deconstruction, yet? One very nice thing in Elixir that ends up removing a ton of (possibly buggy) boilerplate logic on function entry is that the function heads pattern-match deeply on the structure of the input while also doing inline assignments.
- ravi-delia 3y agoI mean depending on what you mean by "have", yes? But also that's been true since the 90s. Out of the box, less so. Clojure has destructuring assignment, but no matching. A lot of little lisps downstream of Clojure (Janet, Fennel I think) do have matching, though not for function calls. I think that destructuring is most of the value add of pattern matching for me- that's not to say matching isn't great, just that destructuring is such a no-brainer value add that its hard to compete with. I do find myself missing the {:error, ...}, {:ok, ...} pattern in other languages. Nil punning doesn't give you anything close to as much, and at significant cost. For pipes, the answer is definitely yes though. Clojure has arrow macros, which let you compose without nesting just like Elixir. (->> [1 2 3] (map inc) (filter even?) (reduce +)) => 6 There's one for threading through the first argument, and another for threading through the last, and various others for specific situations. Because they're pretty simple macros to write, I also use similar macros extensively in my CL code. In fact, I actually learned CL after getting used to Elixir so the first entry to my utilities package was a threading macro.
- fulafel 3y agoI think Clojure has benefited from matching being kept out of the built-in stdlib. https://github.com/clojure/core.match https://github.com/clojure/core.match is a plug-in and as a result we've had lots of cool data traversal/matching DSLs come around and evolved user communities with time such as Meander and Datascript not to mention the parsing applications of the schema systems (spec & malli).
- Capricorn2481 3y agoClojureDart is not ready. I would be surprised of ClojErl was. And GraalVM is not some drop-in native compiler. You might have to radically change your code to work with GraalVm. Proposing these things as "ready for the average Clojure noob" is exactly the snake-oil nonsense that turns people off to Clojure
- deleted 3y ago[deleted]
- erichocean 3y agoThe people who actually use ClojureDart today disagree: > ClojureDart is production-ready: you can ship applications right now. Source: https://github.com/Tensegritics/ClojureDart https://github.com/Tensegritics/ClojureDart (i.e. the developers themselves) See a live coding session/demo given a week ago here and decide for yourself: https://www.youtube.com/watch?v=dqBeGpuedf0 https://www.youtube.com/watch?v=dqBeGpuedf0 ClojureDart is very similar to ClojureScript (which the GP is already comfortable with). If you can create and deploy an app with ClojureScript, you can 100% deploy something with ClojureDart today. Re: Clojure-not-for-n00bs, I 100% agree and haven't met anyone in the Clojure ecosystem who would disagree. Clojure developers have consistently the most experience of any language ecosystem I've worked in over the last 25 years.