6 ms·
I was at a talk by Guy Steele where he mentioned in passing that Clojure was a Lisp which had done everything right. This was all the more impressive to him bec
by bangonkeyboard 6y ago
I was at a talk by Guy Steele where he mentioned in passing that Clojure was a Lisp which had done everything right. This was all the more impressive to him because Rich Hickey had until then been a relative outsider to the Lisp/Scheme community.
- zitterbewegung 6y agoYea Clojure is like the Python of lisp style languages. Good language design and it can interact with Existing Java libraries. (Python does the same thing but with C).
- kgwgk 6y agoCommon Lisp also does the same thing with C.
- mumblemumble 6y agoAnd Hy does the same thing but with Python. I think, though, that the things that Clojure gets right go way beyond just the JVM, though. Clojure's approach to nil punning, for example, is really well thought out.
- fmakunbound 6y agonil punning?
- mumblemumble 6y agoEric Normand explains it better than I could: https://lispcast.com/nil-punning/ https://lispcast.com/nil-punning/ In a nutshell, nil punning is a thing in lisps (and some other languages) where the null value can have different meanings in different contexts. It's comparable to Python's concept of "truthiness" and "falsiness", but more so.
- fmakunbound 6y agoOh that, yeah that's what I'm used to from Common Lisp as well.
- jlarocco 6y ago"nil punning" has been a feature in Lisp since the earliest days, but as far as I know it's only called "nil punning" in the Clojure community. I don't have anything against Clojure (well, I'm a little negative on the JVM), but I personally don't see any reason to move to it from Common Lisp. On the other hand, I'd miss CLOS, and I feel like CL has a better/more consistent design. Something about Clojure always feels like they're "winging it".
- airstrike 6y ago> Python does the same thing but with C Don't think that's really accurate. You don't have to use C with Python, and there's no VM to worry about. CPython* just happens to be the most popular implementation. Clojure (by and large)* requires the whole Java infrastructure, and that is a nonstarter for many.
- jdminhbg 6y ago> Clojure requires the whole Java infrastructure, and that is a nonstarter for many. There are Clojure implementations that run on JS runtimes, the .Net CLR, the Erlang BEAM runtime, etc.
- sitkack 6y agoFor Erlang it is https://github.com/clojerl/clojerl https://github.com/clojerl/clojerl
- lvh 6y agoNit: CPython, not Cython. Cython is a whole different thing that leverages CPython to compile Python programs to C, as well as compile Cython-the-language, effectively annotated Python, to faster C. CPython comes with its own VM: are you saying the issue is "you need to install 2 things instead of 1"?
- roguas 6y agoIt requires jvm. But you don't have to interact with java, sometimes its easier to just use a particular java library, but many people report never having to touch java. JVM seems like a nice to have, a lot of the standard java tooling works for clojure as well (profilers and what not).
- globular-toast 6y agoI just wish it didn't target the JVM. I think if it had a native runtime that loaded quickly like Python it would be more popular. I love Clojure and really wish I could use it, but I just don't do the kind of things that can justify running a JVM.
- chrisseaton 6y agoHopefully that'll come with GraalVM.
- elwell 6y agoGraalVM, ClojureScript, etc...
- keymone 6y agoJVM is not to blame here, it's Clojure that takes a while to load and initialize. Java actually crushes Python in every aspect in terms of performance (which is to be expected of statically typed language).
- lvh 6y agoGP specifically mentioned startup time. It's true that most of the startup time for Clojure projects is a Clojure-specific interplay of things the JVM does (but also not language-intrinsic: ClojureScript on V8 does not share that problem, for example), but default flags CPython still beats default flags OpenJDK for "start and do nothing".
- keymone 6y ago> default flags CPython still beats default flags OpenJDK for "start and do nothing" i stand corrected :)
- dnautics 6y agoit's not the static typing that makes a difference, it's the compilation. As an extreme example, asm is very much not statically typed (hell it's not even considered typed in most circles), and it beats the pants off of Java. As another, less flippant, example, Julia will typically beat Java in most long-running algorithms (but probably not time-to-first-x), because it doesn't have a well-optimized-for-compilation-speed compiler, but it does have a better-optimized-for-running-speed compiler for many scientific tasks. https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/julia.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- rodeph 6y agoHigh praise indeed! Can you provide a source for it? It would be nice to be able to cite it.
- bangonkeyboard 6y agoI can't, sorry. This is my paraphrased recollection of his response to an audience question from years ago, and a quick search doesn't turn up any recordings.
- jwr 6y agoI think what Rich got right is the practical approach. Clojure is about compromises (like all engineering). It's not a theoretical exercise, it doesn't prove a point, it's about getting things done. This also means that sometimes things do not seem as "beautiful" as one might like. Well, that's because they aren't. There is no way to sugarcoat certain things without making the language less practical, and Clojure seems to have been designed with no sugarcoating in mind. Incidentally, I love this quote from Rich, an answer to people complaining that Clojure isn't easy to learn: "Instruments are made for people who can play them". I've grown to appreciate that over the years. You don't expect to be able to sit at a piano of a particular brand and just start playing it.