9 ms·
Isn't Clojure the most mainstream Lisp at this point?
by posix_monad 3y ago
Isn't Clojure the most mainstream Lisp at this point?
- reikonomusha 3y agoI'd say so, but for many, it's "dead on arrival" for a variety of reasons: Java-centric, unabashedly dynamically typed (favoring instead a slightly more eccentric way of enforcing contracts), etc. Unfortunately, a lot of Scheme and Common Lisp people don't like Clojure a whole lot because it gave up on a variety of things that group has treasured.
- 7thaccount 3y agoIt also assumes significant Java knowledge, so I kept finding myself at a dead end where it assumes I know the Java library way to do something and can just call it. I tried Clojure for the Brave and True and Living Clojure. I kept thinking that I wasn't getting anything I couldn't already do in Python (at least for my uses), but there's a lot of baggage like emacs + cider...etc.
- ryanobjc 3y agoThe gap between the clojure libs and the java libs and actually calling java is a jarring experience and really isn't a plus. While in theory the java interop is a selling point, if you don't need that it ends up being extra syntactical complexity. Now I haven't coded extensively in clojure, so a lot of it stylistic unfamiliarity. It does hold back people from adopting clojure. One reason why I'm excited never to use the JVM again is the huge memory footprint it uses. The best practices for production java is to figure out how much ram your process will need max under normal (not leaking) usage... and set both max and min ram to that (Xmx and Xms). It's a real hog on ram, and when running under clustered tools like k8 with can do memory overcommits it really reduces your flexibilty. I'm super psyched for all these tiny go and rust programs that run and use like 50 mb ram or even less. Running a cluster of 50 containers is really no heavier than a single Xmx1g java process!
- deleted 3y ago[deleted]
- pjmlp 3y agoGraalVM and OpenJ9 are the answer to that, before one would need to shell out to commercial AOT compilers like Excelsior JET. If you want to see Java going into where Go and Rust hardly matter, see real time Java used in embedded deployments by US and French militar, in battleship weapons control systems, and missile tracking systems.
- koito17 3y ago> It also assumes significant Java knowledge For interop? Yes. For debugging a JVM in production? That, too. But the same can be said about ClojureScript and ${JAVASCRIPT_HOST}. I picked up Clojure after a few years of using Common Lisp. Everything I know about Java and the JVM is thanks to using Clojure and deciding to make use of Java libraries when the ecosystem lacks a good library for something I need (e.g. WebAuthn). My complaints about Clojure usually boil down to lack of performance (when writing idiomatic Clojure as opposed to "Clo-java") and lack of static typing (most Common Lisp compilers do a way better job here). Although I complain a lot about performance, it's ironic many Clojure users will point out to me that Clojure is still faster than Python, Ruby, etc., because I never use those languages and beating them in performance IMO is a very low bar to clear, unless you consider alternative implementations like Truffle Ruby (but then most of the Python/Ruby/etc. ecosystem is incompatible with your implementation). With that said, Clojure is the only language I know with something like clojure.spec out of the box, and every time I use other languages, I miss being able to treat schemas as data and run transformations on them, especially when dealing with data that has a lot of optional fields (but they are optional only subject to specific conditions). Avoids a lot of repeated subtypes and keeps code concise. I also have an easier time testing Clojure code compared to other languages, in the sense that I rarely have to maintain intricate hierarchies of mock objects and state. Most of my Clojure code tends to be small, pure functions, and stateful things happen at the boundary between e.g. backend and database. So the most complex fixtures I usually have to write is setting up a database. > there's a lot of baggage like emacs + cider...etc. I think you were trying to use Clojure in its very early days, when people were still hacking atop of inferior-lisp-mode in order to provide basic Emacs support. While Emacs is still the majority of editor usage in Clojure, the next significant chunk is VS Code users with the Calva plugin. There is also an IntelliJ plugin and it offers (IMO) the best experience for Java interop.
- lemming 3y ago(disclaimer: I develop Cursive, the IntelliJ option for Clojure). In the recent 2023 survey, Cursive and Calva are pretty much neck and neck, and between them just edge out Emacs. So it's pretty much an even split these days between Emacs and more "modern" options. https://www.surveymonkey.com/stories/SM-_2BH3b49f_2FXEkUlrb_2BJSThxg_3D_3D/ https://www.surveymonkey.com/stories/SM-_2BH3b49f_2FXEkUlrb_...
- rpeden 3y agoIt assumes knowledge of the host platform, which isn't necessarily the JVM. I've been working on a library that targets the JVM, JS/TS, and the .NET CLR. Clojure has let me share about 85% of the code across the three, though to your point the remaining 15% required quite a bit of platform specific knowledge. I'm fortunate to have worked with all the over the years, so Clojure has been a nice power tool that has let me accomplish a lot while working solo. It's not the right tool for every person or every project, though. Since you've worked with Python, you might enjoy Basilisp. It is essentially Clojure with Python as the host platform.
- nescioquid 3y agoMy chief recollection of the Clojure mailing list was countless explanations of what a stack trace is to countless people who had never worked with Java and who had no interest in learning about Java. That was also around the time people had started hyping the JVM as a general language host. Seeing how people struggled on the Clojure mailing list made me rethink that proposition.
- eduction 3y agoI personally never understood why Clojure stack traces alienate people. I worked on python, ruby, Javascript and Perl before Clojure and I seem to recall they had stack traces too. Am I misremembering? The Clojure stack traces are certainly longer. Which is because it’s a hosted language - the Java stack trace plus the Clojure stuff. I suppose the extreme indirection in Java might be part of the problem, where code passes through so many intermediate classes.
- Jach 3y agoThe traces were longer but also so much less helpful for finding the problem than stack traces in other languages, including pure Java. The one I remember getting irrationally angry over how much of a pain it was to track down the bug was where I mistakenly tried to call inc on a string. This was in 2012, I suspect (and hope) it's better now, but later I got more serious about Common Lisp and never looked back (except for occasional thoughts about taking a Clojure job). CL debugging is rather a joy because of its condition system and full live development support that Clojure emulates. (There's also compile-time warnings that tell you about things like incf on a symbol whose derived (or declared) type is not a number.)
- pjmlp 3y agoPeople that think using guest languages saves them from the underlying platform are preparing for failure. Doesn't matter if it is the browser, UNIX, Java, CLR, BEAM,.... eventually that underlying layer will catch one up.
- 7thaccount 3y agoYou're absolutely right and it was a hard learned lesson for me with Clojure, Scala, Kotlin, and F#. I tried all four based on the hype and it kept hurting that I didn't know Java or C#. People would tell me that it wasn't relevant, but then I'd need to do something pretty basic like File I/O and in some cases there wasn't a whole lot out there as it assumed you knew the underlying platform and could just call the method from there. I read books on all of them and tried numerous times to build an app. I finally figured out I'd need to start with Java or C# first and then make the pivot, but frankly...those languages aren't for me and have too much boiler plate. F# too had a problem where there were several well praised books out there, but nearly all of them centered around making the shift from C# to F# or code architecture and practically nothing like the 100 intro to Python books, which is what I really needed. OCaml also has a platform issue, but it's that it mainly only runs on Unix and it also doesn't have what seemed like a great out of the box experience (e.g. https://ocaml.org/docs/file-manipulation https://ocaml.org/docs/file-manipulation).
- sesm 3y ago"Clojure is the gutted and zombie-reanimated corpse of a dream" (:
- uxcolumbo 3y agoWhy so? And where is this quote from?
- sesm 3y agoThe quote is from an old blog post: http://www.loper-os.org/?p=42#:~:text=Clojure%20is%20the%20gutted%20and,as%20the%20future%20of%20Lisp http://www.loper-os.org/?p=42#:~:text=Clojure%20is%20the%20g.... The blog post itself is not very informative, but the quote is poetic, memorable and perfectly captures the sentiment of some Common Lisp enthusiasts towards Clojure.
- deleted 3y ago[deleted]
- beders 3y agoThis is only partial true nowadays. There are at least 4 different options for Clojure fans that dislike Java. BB, ClojureScript in node and browser, ClojureCLR (.NET), ClojurERL. (and a few more). If you love static types, use TypedClojure. It is like many things in Clojure a la carte.
- deleted 3y ago[deleted]
- natrys 3y agoYou have to define mainstream, and it's hard to quantify things when there is no data. If you use statistics from Github[1], there is a strong argument to be made that the most mainstream Lisp is actually .... Emacs Lisp. [1] https://madnight.github.io/githut/#/pushes/2023/4 https://madnight.github.io/githut/#/pushes/2023/4
- aidenn0 3y agoThat's going to be biased a bit by people putting their dotfiles in github. It shows Clojure with 4x the share of CL though. Lisp-1's hurt my brain though, so I haven't dabbled in it much.
- koito17 3y ago> Lisp-1's hurt my brain though No worries! (defn cl-funcall [function & args] (apply function args)) Jokes aside, I've written a significant amount of software in Common Lisp and Clojure. The Lisp-1 vs Lisp-2 distinction isn't something that bothers me. It used to, as a beginner with strong opinions on everything. But nowadays? I don't even remember the last time I've heard Lisp-n before reading this comment.
- aidenn0 3y agoI'm just too used to naming variables things like "list" Having variables that shadow functions, that are later used somewhere causes rather inscrutable jvm backtraces to appear in Clojure.
- koito17 3y agoIf you use the CIDER debugger then this doesn't appear to be a big issue. Try step debugging the following function. I get an IFn related exception right as the call to (list name) is made. (defn f [name list] #dbg (concat list (list name))) (f 'alice '(bob))
- natrys 3y ago
- behnamoh 3y ago> Isn't Clojure the most mainstream Lisp at this point? Calling Clojure a Lisp triggers some people.
- pharmakom 3y agoHow would they define lisp? To me Lisp means programs in list syntax with prefix notation.
- lispm 3y agoTypically a programming language (& family) is a bit more than token syntax. You could write any programming language in prefix notation. C is more than foo{bar}. A programming language has dimensions like: syntax, semantics, pragmatics, implementations, standards, practice, tools, social/community, libraries, code, ...
- bsdpufferfish 3y agoIf Clojure is a lisp, so is JavaScript.
- lispm 3y agoIt may be a prominent, active language in the "market", but among Lisps it's not very mainstream, given that it lacks a lot of things that define a Lisp (which are more interactive, more dynamic, full languages, ...). I would consider it as "a Lisp" not so "mainstream", given that it is has very little backwards compatibility to earlier Lisps, is mostly a hosted language, is a blend of a not so functional language&platform (platform JVM is object-oriented) with functional datastructures, is very opinionated, is BFDL controlled, ... Clojure has also successfully spawned in the last years enough variants/tools/libraries/practice, ... , that it is now a diverse language family on its own.