Live data from Hacker News

Try Clojure

tryclojure.org

51–60 of 404 posts

Re: Try Clojure

#53
post #22

Earlier quoted context omitted.

In my experience, the subsets of the community around clojure were one of the biggest problem with it. It's gotten better over the years, but circa 2016 - 2018 it had a spike in popularity despite being very hostile to newcomers. There was an almost apologist attitude towards rough edges or failure modes folks new to the community would fall into. I managed to work with it for a time despite that, but it left me with…

> ...had a spike in popularity despite being very hostile to newcomers. To be fair the community itself, as humans, was very welcoming to newcomers. Really super nice and helpful folks. If anything was "hostile" it was the dominance of emacs and very limited options for other tooling. That, and the horrifically unhelpful leaky abstractions in the stack trace when something went wrong. It's a big step, if you don't al…

Cursive plugin for IntelliJ is a fantastic option, it's not free but it is excellent.

Re: Try Clojure

#54
post #43

> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.

That's because this is actually ClojureScript (JS under the hood) running as a browser library.

If you try that in Clojure, you'll get:

> ClassCastException class clojure.lang.PersistentList cannot be cast to class java.lang.Number

If you try it in a "proper" ClojureScript dev environment (shadow-cljs), you get nil as a result with this warning:

> cljs.core/+, all arguments must be numbers, got [number cljs.core/IList] instead

Re: Try Clojure

#55
post #22

Earlier quoted context omitted.

In my experience, the subsets of the community around clojure were one of the biggest problem with it. It's gotten better over the years, but circa 2016 - 2018 it had a spike in popularity despite being very hostile to newcomers. There was an almost apologist attitude towards rough edges or failure modes folks new to the community would fall into. I managed to work with it for a time despite that, but it left me with…

A somewhat similar thing I ran into is that existing Clojure code can be incredibly difficult to grok if you don't already know the language very well. Some of this comes from lisp's minimalist syntax, which makes it hard to even know what kind of thing you're looking at when you're encountering a new thing for the first time. But the problem is also compounded by some of Clojure's more distinctive (and powerful) fea…

In Perl you have the dynamism, and the syntax.

Evidently, 93% paint splatters, when OCRed, are valid Perl programs:

https://www.mcmillen.dev/sigbovik/2019.pdf

I doubt that a similar thing is true for Clojure.

Here, the only problem is that you don't know what the symbols and some of the notations mean. You can look at the unfamiliar syntax and know what is a child of what. Most operators are words you can search for.

Re: Try Clojure

#56
post #4

I love clojure, but it's really lost a lot of the momentum it had as many imperative languages have adopted parts of functional programming (and much for the better) over the last many years. On the other side I've felt a lot of the ecosystem work that was done has a more "timeless" quality. Coupled with java interop I haven't ever felt wanting when I do reach for it for some hobby projects I keep up with. One thing…

> many imperative languages have adopted parts of functional programming

nailed it. I don't know much about functional languages other than a haskell course back in the day, but I don't want to do functional all the time. It plays great in some situations and I am happy to use those language subsets in my daily coding, but I don't need my entire application to be written in an esoteric language

Re: Try Clojure

#57
If you are new to Clojure and would like to experiment with it in a way that is immediately useful, I highly recommend the Babashka runtime for scripting [0]. It's very fun, approachable, and one of the more polished parts of the Clojure ecosystem.

It's a particularly good entry point because unlike full-JVM Clojure it has a very fast startup time. Newcomers can use any file-watching /reloading tools (e.g. nodemon) that they're already familiar with to work with it interactively.

Hopefully, a enthusiastic user will graduate to using a REPL connection in their editor for a fully interactive setup. But newcomers tend not to do this... its an unfamiliar workflow to most, and can be pretty cumbersome to setup.

[0]: https://babashka.org

Re: Try Clojure

#58
post #43

> (+ 1 2 '(1 2)) > "3(1 2)" Yup, I'm out.

That has more to do with Javascript being weird than Clojurescript. That would almost certainly throw a good exception when using Clojure / Java.

Re: Try Clojure

#60
post #8

Cool site, I've never tried Clojure before. My first reaction though is that (+ 1 1) is a highly unconventional and possibly confusing way of writing 1+1, and I'm not sure why that design choice came about.

Prefix notation isn't unconventional and it has many benefits.

The main one being if you want to add many many items together it's much easier IE (+ 1 2 3 4 5 6).

Instead of doing an operation between two numbers you are apply a function to a list of inputs. In the "+" function's case you are adding them together. With this in mind, it's no different than most other programming languages. You would never have your function be in the middle of your arguments/inputs.

In python its Foo(bar, bar) and not bar Foo() bar, which obviously doesn't make sense.

Post reply on HN