12 ms·
Clojure isn’t for me (2020)
- delegate 5y agoI think the article should be titled 'JVM isn't for me'. According to the article, the author moved to Janet, because it is Clojure-like without the JVM overhead.
- jcadam 5y agoI think the JVM route is smart for bootstrapping a new language since it gives you an existing ecosystem to leverage. However, at this point, I'd love to see a native Clojure.
- pjmlp 5y agoThere is already Common Lisp and Scheme for that.
- aidenn0 5y agoRich Hickey was already using a native lisp; then he wrote a couple of bridges between it and JVM/CLR before deciding running a lisp directly on the runtime VM was the way to go.
- petre 5y agoYup, Gerbil Scheme is also bootstrapped on Gambit Scheme. And Racket uses Chez Scheme underneath.
- swlkr 5y agoFair enough, I usually start with the title and try to let the rest flow from there, but it's definitely the JVM that was getting me down, not clojure specifically.
- jmchuster 5y agoHow about Clojure on node? Starts and runs instantly https://planck-repl.org/ https://planck-repl.org/
- swlkr 5y agoYes, the newer clojure runtimes like planck or native-image, or babashka definitely take away some of the jvm pain
- nesarkvechnep 5y agoWhy not Lisp on the BEAM - https://lfe.io/ https://lfe.io/.
- crispyalmond 5y agoI prefer to use nbb[0] for this, or babashka[1] when I need to use stuff specific to JVM. [0]: https://github.com/babashka/nbb https://github.com/babashka/nbb [1]: https://babashka.org/ https://babashka.org/
- petre 5y agoJanet was kind if slow when I tried it and it's too different compared to Clojure. I think I'll stick to Racket for playing with Lisps.
- Gollapalli 5y agoIncreasingly, I don't see clojure as primarily a matter of the clojure-on-jvm implementation, but as a distinct and (generally) hosted dialect of lisp. Clojurescript is a clojure. Janet is a clojure. ClojureCLR is a clojure. Fennel is a clojure. Babashka is a clojure. Ferret is (kind of) a clojure. Maybe someday we'll have a bare-metal clojure. So far as I can tell, the lisp landscape (land of lisp?) has changed from common-lisps and schemes, to common-lisps, schemes, and clojures. IMHO. Maybe I overexaggerate. Anyway, the author, from my perspective has decided that clojure IS in fact for him, but clojure on the JVM is not, so he chooses to use a different one.
- fnordsensei 5y agoNo, I think you’re right. Clojure is first and foremost a symbiote.
- spacemanmatt 5y agoThe term widely used is "hosted language"
- simonpure 5y agoI'd also add cgrandes ClojureDart to the list. I would generalize your observation as a logical consequence of Greenspun's tenth rule and conclude that we will eventually get a hosted lisp for any sufficiently relevant programing language.
- gavinray 5y agoBare metal Clojure would be Clojure compiled with GraalVM
- deleted 5y ago[deleted]
- pull_my_finger 5y agoIdk why, but this really rubs me the wrong way. It feels like marketing-speak. Clojure _is_ it's own thing, and so are the other languages (Janet, Fennel etc) that you seem to be detracting as some sort of Clojure spin-offs. Aside from all being lisp-like languages they have little in common that is exclusive of modern programming languages in general.
- valbaca 5y agoOP doesn't need or want the JVM or Java libraries, and he wants to stay in the world of Free software that C and Ruby provide. He analyzed his needs and wants. This is a good example of what "right tool for the job" analysis looks like. Though honestly, if OP wasn't in "java land" (his phrase), I'm not sure why Clojure was even on his radar. I greatly respect people who reject the hype and just go with the language that fits their needs, even if it isn't hyped like C, Ruby or Python but provide plenty of what you'll need. https://boringtechnology.club/ https://boringtechnology.club/
- pixelrevision 5y ago> Though honestly, if OP wasn't in "java land" (his phrase), I'm not sure why Clojure was even on his radar Clojure is really appealing as a language and has enough of a following that it doesn’t seem like a risky bet. It also looks pretty self contained. It’s only when you need to push it that you find yourself with confusing JVM stack traces and all the nuances of that ecosystem. When you do you start to figure out the whole thing is not quite as elegant and simple as it first appeared.
- swlkr 5y agoThis is exactly what I experienced too, the tidy clojure ecosystem can come undone pretty quickly
- joshlemer 5y agoI dunno, in my experience even something as simple as a tiny syntax error can already get you into pretty deep and inscrutable stack traces.
- capableweb 5y agoSyntax errors like unbalanced brackets/parenthesis/curly braces? Those should definitely give you "pure-clojure" errors as the parsers can't even read the source at that point. Only time you should be getting JVM stack traces is runtime errors.
- swlkr 5y agoI'm not quite sure why my stuff keeps hitting the front page, but I'm here for it. I've since abandoned janet for web app side projects and gone back to ruby entirely but yeah, I still love lisp but it makes more sense to align my work programming language with my side projects that way I can ship my side projects faster, at least that's the thought now.
- capableweb 5y agoAs the submitter of this story, I can tell you about why this one landed there. I found the link via the discussion on the previous one (https://news.ycombinator.com/item?id=30917772 https://news.ycombinator.com/item?id=30917772) and submitted it shortly afterwards (https://news.ycombinator.com/item?id=30929823 https://news.ycombinator.com/item?id=30929823). It didn't end up on the frontpage though, but I got invited to submit it to the "second chance pool" (https://news.ycombinator.com/invited https://news.ycombinator.com/invited) where submissions get exposed to the frontpage for X hours and if they manage to stay up, they stay there naturally. Seems like people enjoy your writing enough to make it stay for at least some moments :) As a Clojure fanatic, I too enjoy your writing and hoped to stir up some interesting discussions around Clojures weak-points by submitting this story.
- swlkr 5y agoI'm not sure if it's about clojure's weak points or my own weak points haha
- spacemanmatt 5y agoheh, that's literally the most relatable commentary in this whole topic
- flakiness 5y agoThe author's next choice is "Janet", which I haven't heard of: https://janet-lang.org/ https://janet-lang.org/ Not sure how it is better than Ruby. But maybe the author wants something fresh to play with - that I can totally relate to. Good luck with the new journey anyway!
- d3nj4l 5y agoThe author mentions elsewhere in the thread that he has since largely gone back to Ruby: https://news.ycombinator.com/item?id=31044646 https://news.ycombinator.com/item?id=31044646
- mjburgess 5y agoI think the "C-derived open-source world" is a good way of putting it. The java-world is an inscrutable place of gigantic IDEs, maddening dependency graphs, perverse build systems. Everything is just-so-poorly-compiled enough that it's a nightmare to work with. It sucks all the joy out of programming in my experience.
- seertaak 5y agoI mean, it's kind of farcical to complain about Java build systems and compare that to C, which has literally the worst build system/dependency management tooling. Even with vcpkg and conan (which are infinitely better than what existed before), building projects with 4-5 dependencies (abseil, boost, folly, and range-v3, say) requires understanding why builds break complaining about iterator traits under C++20 on Clang 13. It's insane. How can Java possibly be worse than that? It may not be as nice as rust or python (even python can be pretty insane for dependency management, actually), but with Maven I could add 3/4 lines to my project, and in my IDE the dependency would "just work" and I could even navigate to the source code of the dependency. And it's not like this is a slow language, Java is like 80-90% as fast as C if you know what you're doing, and for most use-cases, and isn't brain-dead in its handling of threads. I'm a C++/Python developer, by the way, although I've had day jobs writing Java too. I honestly think this is way off base; it's a great language which has constantly evolved, and the JVM is a fantastic piece of technology. Rich Hickey was super smart in targeting the JVM, it was a great decision, and to my mind OP hasn't a clue of what he's talking about.
- oriolid 5y agoFor C and C++ Meson is quite nice.
- swlkr 5y agoI will say as far my limited understanding of the JVM goes, it seems like container tech can take care of any system dependencies that you might need for a complex c++ build. It also seems that the JVMs original purpose of running the same code across operating systems/architectures has also been superseded by containers, better cross compilation (llvm) and possibly wasm as well. Maybe at some point in the future, the JVM will mostly be relegated to legacy systems and most new software (assuming AI isn’t writing all future software) will target wasm or require some container runtime.
- adenozine 5y agoWhere could someone read about implementing immutability checks in a compiler? I’ve always wondered if there’s a way to know at compile time whether a value is being mutated, rather than throwing a runtime exception.
- khnov 5y agoRust compiler do exactly what you need
- adenozine 5y agoI wouldn't bother with rust under any circumstance. And in any case, I'm wondering about compiler-writing resources, not compilers. I daresay you didn't even read what I wrote and just typed "hurr, Rust is good." I've seen a million comments like this, and it's largely the reason I'll never bother.
- scns 5y agoHe gave you an answer and your are beeing rude to him. Maybe check out how the Kotlin compiler does it.
- khnov 5y agoI think you didn't read what I wrote, did I say 'rust is good' ? I meant the rust compiler contains logic you are searching for. And you need to learn about being polite to people trying to help you.
- Tainnor 5y agoThis article is incredibly light on specific details about what exactly about the JVM is problematic and just vaguely hints at it not being open-source enough (despite OpenJDK having been a thing for ages), something that I consider to be more ideological in nature than pragmatic. As someone who has written Ruby for years and more recently switched over to the JVM, I don't see the big deal. Both ecosystems have their advantages and disadvantages. The fact that so much of Ruby's ecosystem is built on C has its downsides too, e.g. compilation errors on "bundle install" because your version of nokogiri doesn't work with whatever C libraries are installed on your system anymore, or a frequent need to install new ruby versions which can be rather slow when you have to compile them from scratch.
- oriolid 5y agoBack in the day when I wrote Java for living, it was too common pattern that development is done on OpenJDK until we hit some mysterious problem. The problem then disappeared when we switched to Oracle JDK. Other problems are that Java's "everything is an object" and "generics parameters are lost at run time" ideas poison every other language too, and garbage collection never works as intended.
- Tainnor 5y agoIn Ruby, everything is an object too (actually even more so than in Java) and in dynamically typed languages, generic type parameters of course don't exist, so I don't understand how those things matter to Clojure or (J)Ruby. Garbage collection pauses may be slow on the JVM, but Java is still miles faster than Ruby (idk about clojure).
- swlkr 5y agoclojure on the jvm has much better performance than ruby, but for my small side projects, that doesn’t matter. I guess I was trying to describe the frustration of switching languages and ecosystems while also trying to ship, thought I could do it, but I couldn’t. I suppose I would have had a much better time and stayed in C-land (and gotten much better performance) if I had tried golang instead of clojure.
- casion 5y agoThis submission isn't titled correctly despite it being the title of the article. The author has an issue with the JVM, not Clojure, and then chooses a dialect of Clojure (I assume because they like Clojure and it is for them). It would be nice though to understand what the author believes the issues with the JVM are since they they aren't expounded upon in the article.
- swlkr 5y agoI should have gone into more detail for sure. The problems with the JVM are more cultural or political and not necessarily technical, although at the time clojure on the jvm did require quite a bit of memory and the cold startup times weren’t great for a simple, “watch this file in development and restart the server” workflow.
- capableweb 5y ago> “watch this file in development and restart the server” workflow Fortunately, no one in the Clojure ecosystem works like that, thanks to the REPL :) You fire up the server, send code straight from the editor to the server and evaluate everything on the fly, no restarts needed.
- swlkr 5y agoYes the repl was one of clojure’s strong points, definitely, but I would argue that a fast restart + logging + irb gets you most of the way there
- casion 5y agoWhy shoot for "most of the way there" when one of the core features of the language is "all the way there"?
- swlkr 5y agoThe downsides of clojure on the jvm which I had kind of forgotten about until today like long stack traces and using a lot of memory kind of outweigh the upside of the repl
- chefandy 5y agoMinor point: Proprietary UNIX OSs aren't artifacts of the seventies. OSs like AIX and Solaris live on. A former employer sells enterprise software for both of those environments to this day. Banks, especially, seem to love AIX in my experience.
- swlkr 5y agoWow that’s crazy, I love learning new tidbits about how older tech like cobol or mainframes or something are still around and plugging along
- chefandy 5y agoKind of mind boggling. You figure "surely there must have been a point at which being that change-averse bit them in the ass hard enough to modernize their approach" but... guess not. In fact, one large banking system I worked on in the late aughts completely revamped their megalith of a back-end for a major component of their system and the only two things they didn't change were using AIX and Oracle.
- scns 5y agoRich Hickeys Company Cognitect is now owned by a bank from brazil. They started off with Clojure though.
- spacemanmatt 5y agoI'm still supporting a legacy app running PHP5 and Java 1.4
- chipotle_coyote 5y agoHuh. I genuinely didn't know Solaris -- the closed-source commercial version, rather than offshoots like Illumos and OpenIndiana -- was still kicking around, but sure enough there's an "Oracle Solaris 11" page.
- chefandy 5y ago
- warcher 5y agoNot gonna lie, I think the jvm integration is a big win for clojure as a language. The fact that you can pull in and interop with established jvm tools and libraries makes using a niche language like clojure a possibility for professional development. C libraries are wonderful tools when you need a low-level library to run hot, but if you need, I don't know, a database adapter or a queueing library and you don't want to write one, I'd much prefer pulling something out of maven than trying to integrate a C library. There's just a lot of infrastructure the jvm gives you pretty easily. If you're just messing around with fun side projects, there's nothing wrong with using something you enjoy for no other reason than your own personal enjoyment.
- pkulak 5y ago> If you're just messing around with fun side projects, there's nothing wrong with using something you enjoy for no other reason than your own personal enjoyment. That was my thought too. If it's a side project, I guess you should just always use Python because you will never need anything else. But I already kinda know Python and it doesn't interest me much, so I write my side projects in the flavor of the day that has my fancy at the moment.
- petre 5y agoPython has lots of third party library support. You can basically do pretty much anything. I had to write some proof of concept code that talked ISO-TP on the CAN bus and guess which language other than C had libraries for CAN and ISO-TP? Python. Fortunately we found a serial to CAN gateway and I was able to do it in Ruby over the serial port. Soon we'll have to rewrite part of it in C/C++ on some embedded board, probably ESP32 because it has CAN and WiFi built in. But I think it's perfectly doable in micropython as well. ESP32 CAN bus support for micropython is currently being worked on.
- pjmlp 5y agoSome proprietary UNIX in the 70's?!? I guess he also never saw the price of ISO C document that someone has to pay so that GCC actually supports C the proper way. Talk about being precise on the details.
- swlkr 5y agoI did gloss over a few things there, the goal was to say, yes I understand that C-land hasn't always been as free and open source as it is now
- gtoast 5y agoJanet vs Babashka vs Fennel - anyone have thoughts?
- pull_my_finger 5y agoThey're really pretty different so if depends on your goals and your environment. If you're scripting something Lua-scriptable like OpenResty/Haproxy, or you want to piggyback off the Lua ecosystem of modules you're looking at Fennel as your choice. If you want more built-in batteries and you aren't tied to Lua, you may prefer Janet although the ecosystem is young. If you like Clojure but don't want to use regular Clojure, I guess you'd prefer Babashka. Of the 3 I've not used Babashka, so I'm not sure the sell here. Is it just an alternative runtime I guess?
- mproud 5y ago2020?
- swlkr 5y agoOh yeah that's interesting, I wonder what the threshold for year timestamps is, I thought it was > 6 months after a new year
- brundolf 5y agoI think the takeaway here is that any language or ecosystem has an unspoken culture, set of habits and norms, set of assumed background knowledge, and general "look and feel" to it that matter to the productivity and overall satisfaction that any given developer will get, based on their personality and past experience. We often ignore these aspects when doing something like picking a language, but they really do make a difference.
- tomatowurst 5y agoi think the biggest point is that it's hard to find developers in a special niche even if it allegedly offers productivity gains, this is negated by increased costs. clojure was cool, I used it mainly for datomic, but the gains really dont justify relying on public slack channels and mailing lists to hire and find devs. I really see this from an economic point of view. I could be mistaken based on my own experience dealing with clojure and datomic in particular. I'm just not sure the gain is there anymore as other databases built on conventional tech stacks increasingly more or less take away the gains.
- roguecoder 5y agoYour comment reminds me of this 36 year old paper: http://worrydream.com/refs/Brooks-NoSilverBullet.pdf http://worrydream.com/refs/Brooks-NoSilverBullet.pdf It describes how no technical improvement alone can get an order of magnitude improvement in software development efficiency, so the ways available to increase development by an order of magnitude are learning to use already-built components, shrinking feedback loops so we can be sure we are building the right thing, and growing the profession.
- tomatowurst 5y agoah interesting that this axiom is that old and it certainly rings true. boring stacks are still in heavy demand.
- roguecoder 5y agoI appreciate that this article acknowledged that subjectivity, especially in the LISP world where positivism is common.
- spacemanmatt 5y agoIf you want concurrency without trouble, it's hard to beat Clojure.
- haspok 5y agoFunny how the author complains about Clojure because it compiles to JVM bytecode, and then chooses another LISP compiled to... another kind of bytecode? > The Janet language is implemented on top of an abstract machine (AM). Greenspun's tenth rule comes into my mind. For comparison, the JVM has been developed for almost 30 years now, hundreds of thousands of hours were invested in it, runs virtually on every platform on a planet. It has advanced JIT and GC capabilities, and can compile to native. Even Clojure has been around for about 15 years now, and it has successfully carved its niche in the Java world. Janet on the other hand... is a 4 years old hobby project? No disrespect, but they are not in the same league. Just a side note: it is probably the easiest thing in the world to implement your own LISP - it is a fun thing to do, you can start very small and get something working within hours. So if you are into it, you should probably roll your own too!
- woolion 5y agoAuthor does not complain that it is compiled to bytecode, he complains that the language is tied to the Java environment, and prefers one that is tied to C. He prefers this because of the investment he already has in this environment, as well as it's philosophy and practice (programming in Java world is assuredly something else). When you start with "no disrespect", with high probability what follows is disrespectful. Did he make the claim Janet was in the same league? He starts by clearly mentioning this is in the scope of his side-projects, so enjoyments trumps marketability.
- Tainnor 5y agoI mean, the author mentions elsewhere in this thread (and on his website) that they switched back to Ruby on Rails because they needed to ship.