7 ms·
Clojure is a trinity of language, REPL, and structural editor
- LAC-Tech 4y ago
- auggierose 4y agoClojure is an extremely fine piece of engineering, and was quite a breath of fresh air at the time of its introduction. It allows you to run stuff on the JavaVM, which was everywhere back then (still is, actually), and in the browser via JavaScript. Hickey made it happen out of thin air. That's why I take him seriously. By the way, "complect" is an actual word.
- maegul 4y agoFrom my memory of the popular talk in which he used “complecting”, he was quite open about how silly it is or might seem as a word.
- LAC-Tech 4y agoIs that the one where he showed the audience how he used to write Java (with static classes everywhere), and you realised... oh shit, this guy did not understand how to write Java at all?
- whalesalad 4y agoClojure runs atop the JVM. The magnificence of full interop and STM (software transactional memory) suggests a certain level of mastery of the Java language.
- elwell 4y agoI love Clojure, but the Java source is oddly formatted which I never understood: https://github.com/clojure/clojure/blob/527b330045ef35b47a968d80ed3dc4999cfa2623/src/jvm/clojure/lang/Keyword.java#L34-L53 https://github.com/clojure/clojure/blob/527b330045ef35b47a96...
- wtetzner 4y agoHe understood how to write Java, and attempted to do functional programming in Java, knowing full well that it wasn’t idiomatic.
- WillPostForFood 4y ago"a Californian accent" FWIW, Hickey has hardcore east coast accent, sounds nothing like any Californian who hadn't recently moved from New York or Massachusetts.
- kgwxd 4y agoHe jokes about how his formula for talks is just look up a word in the dictionary and "you're done". For example, the word "Complect" (which even my spell correct engine thinks is wrong) https://www.merriam-webster.com/dictionary/complect https://www.merriam-webster.com/dictionary/complect
- maegul 4y agoSo I’m just going to throw this out there … words are deeper than dictionaries. Especially in intellectual conversations concerning abstract or complex concepts, the synthesis of “new” words is pretty fundamental. The line between sentence and word in terms of the composition of elements into new combinations is less clear than a basic language understanding indicates. I call this excessively constrictive lexicality, for want of a better word.
- dang 4y agoPlease don't cross into personal attack. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- whalesalad 4y agoBruh... Rich Hickey is straight up a brilliant guy. Clojure is a brilliant language. You are getting hung up on little details that are going to derail your life experience. Instead of focusing on these things that are unfamiliar to you and attacking them, why not pause and consider that there might be some real value here you haven't been able to recognize yet?
- jrvarela56 4y agoI preach about using the REPL non-stop to my coworkers and we don't use Clojure. The problem with REPL-driven development is that you need to invest in your setup - so you have to believe it's worth it. Not even the Clojure REPL works out of the box: you need to make sure your definitions are reload-friendly, Emacs/Calva have to be connected for you to eval stuff with commands, use comment blocks as scratchpad, etc - it's a bunch of little conventions you need to buy into. That being said, the setup cost is paid pretty quickly. Developers underestimate how much time they waste reloading stuff into place. Updated a function - woops, have to clear the variables I setup and run intermediate steps all over again. Even if you think 'yeah but I just write tests and those run the whole flow' using a REPL is worth it. I work with Rails, use guard and try to keep tests fast by sticking to POROs and still does not beat the interactivity of the REPL. One workflow that comes close is working with Elm's compiler. Super friendly and interactive; gives you a similar iterative flow as a REPL but in a different context.
- __MatrixMan__ 4y agoIt's good to see this acknowledged. I tried to learn Clojure and appreciated the language but I just couldn't get my vim head around the emacs ecosystem well enough to experience the nirvana. I may well try again.
- Fellshard 4y agoThe vim/evil-equipped distributions go a long way toward helping with this.
- jrvarela56 4y agoI haven't used vim in years but there's a package by Tim Pope: https://github.com/tpope/vim-fireplace https://github.com/tpope/vim-fireplace This is a key piece of the REPL workflow: you rarely type into the REPL, you use commands in your editor to select code and run it in a REPL. The idea is that you eval stuff in the same place you type, and that gets run in the same environment over and over again without having to restart it or redefine the data you're using to iterate your functions.
- 4y ago
- chimen 4y agoTried it, liked the language but hated the setup. You have to be a hardcore fan to run with CJ and present it at work for others to consider. So...apart from hobby projects, my 2c, "ain't nobody got time for that". I wish it had a better ecosystem and tooling though since I'm 99% sure this language crawls due to it drowning at the vim level still.
- gleenn 4y agoI thought that until I found Cursive which is a Clojure plugin for IntelliJ. I used IntelliJ for Ruby and Java for years. It's extremely good and probably much more familiar than something like Emacs if your background is with a GUI editor.
- fulafel 4y agoI think the setup fiddling is similar in a case where you're coming to a Java shop / project vs coming to a Clojure shop / project. It's not as frictionless as eg Ruby or Python but it's still pretty straightforward.
- ilrwbwrkhv 4y agoClojure has so much boilerplate to get started though. It is a shame that it requires so many incantations when it makes fun of Java's verbosity. I have moved to Common Lisp and it is much simpler and saner, while having the same REPL driven development.
- pgayed 4y agoWhat would you suggest for someone who wanted to get started with CL? Emacs and SLIME? (It would be nice to tinker.)
- ilrwbwrkhv 4y agohttps://marketplace.visualstudio.com/items?itemName=qingpeng.common-lisp https://marketplace.visualstudio.com/items?itemName=qingpeng... Is great for vs code but emacs and slime works of course.
- ravi-delia 4y agoWhat boilerplate does it need? If nothing else, for CL you need to get quicklisp seperately, while deps.edn handles that for you. I love CL, and going from automatically debugging in the repl to what are perhaps the worst stack traces I have ever seen wasn't great, but I'm seeing a lot of people mention a difficult setup I saw no trace of.
- yogthos 4y agoSaying that CL is simpler and saner than Clojure is a pretty hot take. CL is a huge and complex language with lots of legacy decisions and quirks. Clojure is a far smaller and more focused language by comparison. Meanwhile, things like data structure literals and destructuring remove a ton of boilerplate present in CL.
- rrrrrrrrrrrr2 4y ago[deleted]
- jrvarela56 4y agoThis is a great summary of what makes Clojure-the-language awesome to work with. The REPL is way too complicated as a selling point, but it's THE concept I took from Clojure and ported it to my workflow in other languages. It has made me appreciate Hot Reloading in front end apps (and make sure it always works perfectly), make my Ruby console reload friendly, organize my React apps so business logic stays in models I can use in a REPL.
- deleted 4y ago[deleted]
- monzool 4y agoI've been trying to learn Clojure (well, actually Babashka (https://babashka.org/ https://babashka.org/)) from a book, but the whole REPL thing and its workflow benefits didn't really convey well from such a media. It wasn't until I saw a real workflow example (https://www.youtube.com/watch?v=jm0RXmyjRJ8 https://www.youtube.com/watch?v=jm0RXmyjRJ8), that I grokked what REPL development brings to the game. It's quite possible I haven't unlocked its full potential, but I do see value in this way of working. I'm using Calva + vscode and the onboarding seemed pretty simple. Installed Babashka using linuxbrew, then installed Calva in VScode and ran its tutorial. Calva has a pretty good guide on the structural code editing: https://calva.io/paredit/ https://calva.io/paredit/ Now I "just" need to figure out how to parse xml. Zippers melt my brain
- boxed 4y agoThe parinfer argument is funny. It's quite literally an argument for syntactically significant whitespace. With parinfer you can just remove the parenthesis in most cases! Or rather, parinfer will infer them. So.. if a computer can infer them always... why do you have them?