Hacker News new | ask | show | jobs
by BaculumMeumEst 805 days ago
For web server stuff, I still think Clojure is extremely solid. But I’ve come to really prefer Racket for general purpose programming.

I really like the package manager, I like that there’s an IDE with a visual step debugger (seriously, why do almost no lisp people value this?), that it’s multi paradigm, and that the language continues to improve and evolve.

Clojure just has so many finicky or annoying things about it. The design of deps.edn/clojure CLI and the lack of user friendly tooling is forever frustrating. Laziness and its implications being invisibly core to the language is annoying as well.

8 comments

I spot 6 points in that comment and most of them strike me as fair. But two I think are not:

1) The language evolving all the time is an anti-feature. Clojure is an oasis for the people who are tired of having their knowledge obsoleted by constant change that doesn't really improve anything. People can build whatever weird and wonderful features they want using macros in their own library.

2) deps/edn - the design seems to support toolmakers more than end users. I hated it myself (tinged by poor documentation at the time which has since been remedied). But for anyone else having similar issues; the answer is to jump to leiningen [0] which is by far an easier way to set up a Clojure project.

Deps is ok, but lein is what I'd recommend to anyone as a starting point.

[0] https://leiningen.org/

Racketeers also typically use the macro system, which is exceptionally robust and sane, for new features. The base language has been very stable for a long time. That's how the typed dialect is implemented, which you can use with ease on a per-file basis in your project where performance is important, and it also supports at least a couple of Scheme standards in the same way.

Another thing that's nice with Racket is that it can produce binaries, and while the cross-compile story is kind of messy the language as such is actually, really, multi-platform. Even the GUI-library, which is quite nice, especially with gui-easy additions.

Yes! The binaries and gui-easy are both great!

And I just love how easy it is to do everything in Racket. Creating an executable, adding a package, including a module, even spinning up a new file and putting it in SICP compatibility mode - all of these things require 0 memory or reference with a manual because they're so straightforward. Everything is very nicely designed.

Most Clojure devs I know already have lots of experience and can debug faster in their head, with the occasional help of printing a value. But check out this cool Clojure debugger, it even has time travel https://www.flow-storm.org/

We also have a debugger in Emacs/CIDER.

Your other complaints read like you haven't dug really far, or they are outdated.

> The easiest way to run and learn FlowStorm with ClojureStorm is by running the repl tutorial, like this :

;; on Linux and OSX clj -Sforce -Sdeps '{:deps {} :aliases {:dev {:classpath-overrides {org.clojure/clojure nil} :extra-deps {com.github.flow-storm/clojure {:mvn/version "RELEASE"} com.github.flow-storm/flow-storm-dbg {:mvn/version "RELEASE"}} :jvm-opts ["-Dclojure.storm.instrumentEnable=true" "-Dclojure.storm.instrumentOnlyPrefixes=user"]}}}' -A:dev

;; on Windows clj -Sforce -Sdeps '{:deps {} :aliases {:dev {:classpath-overrides {org.clojure/clojure nil} :extra-deps {com.github.flow-storm/clojure {:mvn/version """RELEASE"""} com.github.flow-storm/flow-storm-dbg {:mvn/version """RELEASE"""}} :jvm-opts ["""-Dclojure.storm.instrumentEnable=true""" """-Dclojure.storm.instrumentOnlyPrefixes=user"""]}}}' -A:dev

————

I hate this so much

What do you hate about it?

You can run a project with a library in a repl with a one liner - seems handy. Don't even need to create a file

Because these god forsaken strings are how you do everything in Clojure CLI. When you start a new project, you write them by hand. You flip and fiddle with plain text flags and weird nested hash tables to change tool behavior, and you have to remember so many little stupid things. It makes actually doing stuff feel horrible. There should have been a high bar for supplanting Leiningen and this should not have cleared it.
But wasn't the example in question for a tutorial repl setup for you getting up and running with no config? That seems like a nice user experience for someone who wants to get up and running by just copy pasting a one liner...

What projects are you working on where you are using nested hash tables passed in as strings to the CLI that couldn't be written as data in a deps.edn?

What tools do you miss from lein (genuine question) moving to deps.edn was mostly painless for the teams I've worked wit

You can just copy paste this and replace RELEASE with the version number. If you want to dig deeper, the CLI and deps options used here are well documented under https://clojure.org/reference/deps_and_cli
Very true. Also, while I agree that Clojure is solid for web server stuff, it wouldn’t be my first choice in the context of general purpose web apps or APIs.

The “do-it-yourself” mentality that is at the core of Clojure dev culture results in a less rich library ecosystem. Not only you often end up writing custom code for a generic feature, the rest of your team cannot reuse their past experience but has to learn your custom code and maintain it.

What? If anything, we have a "do-it-right" mentality :) The Clojure library ecosystem is very rich with new libraries coming out every week. We also reuse the rich Java library ecosystem to a large degree. I'm with Clojure for 10+ years and I don't "often end up writing custom code for a generic feature". Its quite the opposite. Clojure is a language that has hundreds of extremely well composing generic functions built in, that operate on a very rich set of first class immutable datastructures. Whatever Clojure you base your impressions on is very different from the one I know and use...
While I love Clojure, I have to agree about tooling. I recently started using Gleam* and was impressed at how easy it was to get up and running with the CLI tool. I think this is an important part of getting people to adopt a language and Clojure dropped the ball a bit on this.

* https://gleam.run/

The big push for people to use the Clojure CLI tool seems like shooting themselves in the foot.
I still use Leiningen since it covers practically all of my needs, including the needs of the teams in the past two businesses I've worked for. The Slack group has pretty vocal people pushing for deps.edn. It's a bit amusing seeing people slowly build their own Leiningen out of ad-hoc Makefile^W^W Babashka scripts and copy-pasting build.clj files across their projects. (Not to mention, nobody can remember what the -X, -A, -T, ... flags do, so that is a major reason Makefiles or Babashka scripts are commonplace in projects that don't use Leiningen)

If you're familiar with Java, then you can think of Clojure today as going through its Apache Ant phase. Some people love it, some people hate it. I personally want to spend 0% of my time building build tools; thankfully there is a pretty solid build tool that is still maintained and will continue to work for the foreseeable future.

Agreed.

I started with lein, and still use lein for any 'production ready' project, but I'll use deps.edn for little personal scripts because in those cases lein feels like bloat. For me, using deps.edn was straightforward because of my previous experience with lein.

There is a lot of strange shade in the Clojure community; like that thrown at lein.

In addition to lein, the ones that get me a lot of negative attention are the community's opinion that (loop ) is an antipattern in spite of it being more performant than the comparable built-in functional patterns, and (first ) and (second ) being preferable to (nth )s in spite of (nth )s also being more performant.

https://leiningen.org/

I agree. I have been a casual user of Clojure for many years, really since the beginning, and lein has always worked fine for me.
> The design of deps.edn/clojure CLI and the lack of user friendly tooling is forever frustrating.

"user friendly tooling" and ANY Scheme in the same sentence?!

I kid, but I always have held that Schemes feel like "tools for building a programming language" (the insanity that is (car ), (cdr ), (caadadr ) suddenly reveals its usefulness when you write an s-expression parser) and Clojure feels like "an actual programming language" with its benevolent use of brackets, build tools, and library ecosystem.

    (defn my-func [arg0 arg1] ..)    -- Clojure
    (define (my-func arg0 arg1) ..)  -- Scheme (of which Racket is one)
Racket seems to want to inhabit the space between those two with its package system and ability to compile to an executable.

One thing I've always liked about Racket is its refusal to accept (if )s without else statements, insisting instead on using (when )s.

> why do almost no lisp people value this?

We do, that is why Cursive exists.

The problem are the folks educated in SBCL + Emacs that never used anything else Lisp related, including the survivors of the Lisp hype wave like Lisp Works and Allegro Common Lisp.

IME Cursive has been very jank. Debugging intermittently fails to trigger on my web projects across multiple machines. It has not been as positive experience as I've had with Racket's IDE (or LispWorks! I love LispWorks!)

The other issue with debugging is perhaps a "me problem", but it's not uncommon for me to have to re-discover where laziness is present in Clojure's ecosystem while debugging. I don't like laziness being implemented on core functions - I think they should be explicitly named alternate functions. Laziness everywhere + "super stable language" = forever annoying. I guess this is only an issue for others who seldom use Clojure as a hobby language - I'm sure people who use daily are able to cope better.

I own LispWorks, I have Symbolics Genera. I've used MCL. I almost never found a stepper to be particular useful to my problems. The other debugging tools were more useful.
Wait... What is the Janet IDE you are talking about here? I had no idea that happened, but can't seem to find reference to it on the website or anywhere.
Hwhat