News for hackers. Stuff that matters.
Re:State of Clojure 2020 by iLemming on Friday February 21, 2020 @01:29AM (#22381316)
> But I would take any functional language with types over it

Which is what? Scala? Haskell? OCaml? F#? Typed Racket? Idris?

I think Clojure really hits the sweet-spot between stupidly boring, "pragmatic" PLs and idealistic, novelty, academic ones.

Haskell is awesome, but realistically it is really difficult to quickly train someone to the point of them being able to write production-ready Haskell code.

Scala has its own warts (besides, Kotlin seems to be slowly eating its pie);

OCaml still struggling to get any recognition in the industry, despite all attempts from a few good players.

I disagree with the notion that Clojure is not suited for large projects, but I agree that Spec needs to be improved (and it is being actively worked on). And I don't think it is not well thought out. Rich Hickey is famous for slowly, carefully, patiently designing things. Stability and predictability of Clojure and its standard library is phenomenal. For every single language (even those I have never worked with) I can probably name a thing or two off my head that involved breaking changes. Not for Clojure.

Re:State of Clojure 2020 by ernst_klim on Friday February 21, 2020 @02:14AM (#22381458)
> Which is what? Scala? Haskell? OCaml? F#? Typed Racket? Idris?

We have one 100k loc project in Clojure and one 500k in OCaml and I would choose OCaml over Clojure any time any day. I really like that things don't brake accidentally when somebody changes code, and the amount of tests you need to write are orders of magnitude smaller.

> OCaml still struggling to get any recognition in the industry

So does Clojure. Both are extremely niche below the radar languages, so it's not a dichotomy really.

There is a dichotomy of choosing OCaml or Java/C#, but Clojure would be on OCaml's side of things here.

Today, if I'd need jvm, I'll simply take modern Java.

> despite all attempts from a few good players

The few players we have (JS, Facebook, LexFi, Citrix, unis) are doing well enough producing enormous amount of high quality libraries. At least in the domains of system programming OCaml is tightly packed with all sorts of batteries.

Re:State of Clojure 2020 by fishmaster on Friday February 21, 2020 @11:43AM (#22384464)
> Today, if I'd need jvm, I'll simply take modern Java.

100% Kotlin. Doesn't even have to be Clojure or ABCL.

Re:State of Clojure 2020 by kccqzy on Friday February 21, 2020 @01:57AM (#22381408)
> Haskell is awesome, but realistically it is really difficult to quickly train someone to the point of them being able to write production-ready Haskell code.

A former colleague once said that many companies using Haskell don't really want to spend money training existing developers to learn Haskell; instead they want to hire programmers self-motivated enough to learn Haskell on their own.

Re:State of Clojure 2020 by keithasaurus on Friday February 21, 2020 @01:51AM (#22381388)
> Which is what? Scala? Haskell? OCaml? F#? Typed Racket? Idris?

If I want JVM interop, I'd use Scala. Or yeah, as you mention, Kotlin isn't so bad either.

For a fun project, I'd use Idris, Haskell, or Rust (of course, many people may not consider Rust a functional language)

On the frontend, Elm or Purescript.

> I disagree with the notion that Clojure is not suited for large projects

True, large projects can be maintainable or unmaintainable in just about any language. But there's a reason dynamic languages like javascript, python, ruby, and php are seeing such heavy investment into gradual typing: it's helpful to have easy-to-digest information about the shape of data going in and out of functions. Almost nothing about spec is immediately self-evident -- it just gives you more code to read and reason about.

Re:State of Clojure 2020 by kamaal on Friday February 21, 2020 @01:51AM (#22381385)
>>Which is what? Scala? Haskell? OCaml? F#? Typed Racket? Idris?

These days Java works just fine. Why use anything else, that neither has dev mind share nor the library ecosystem remotely the same as Java.

Re:State of Clojure 2020 by ilikehurdles on Friday February 21, 2020 @09:29AM (#22383326)
When I was last at a Java shop, we we're pushing multiple-thousand line PRs every week, a good 40% of those lines were simply boilerplate generated by IntelliJ, and it would have been worse had we not fully instrumented our codebase with Lombok, and all this was for a pretty mature product that wasn't seeing any radical changes from day to day. At the clojure shops I've worked at since, we're building more and delivering product faster, and we're doing it on the JVM with less than a third of the lines of code. A thousand lines of clojure is a significant refactor or a big feature. A thousand lines of java is wednesday.

For me, clojure provides a simple-to-use API, high-level functional abstractions, an instantaneous feedback loop, access to a battle-tested JVM ecosystem, and more than fast enough performance. This is its killer combination, in my opinion. The immutable-by-default data structures are also an underappreciated boon for writing multi-threaded code without breaking a sweat.

Re:State of Clojure 2020 by e12e on Saturday February 22, 2020 @07:47AM (#22390728)
> When I was last at a Java shop, we we're pushing multiple-thousand line PRs every week, a good 40% of those lines were simply boilerplate generated by IntelliJ

This actually one of the things I like about Kotlin - many of it features are similar in effect to pre-generated boilerplate - but it lives as part of the run-time, not in your code.

On the flip side, a new version of Kotlin could potentially introduce/reveal bugs - but at least you don't have to deal with four different generations of outdated boilerplate when diving into old code...

Re:State of Clojure 2020 by kaoD on Friday February 21, 2020 @04:33AM (#22381978)
The library ecosystem is accessible from the many compile-to-JVM languages.

Half tongue-in-cheek, half serious: not having Java's dev mindshare is actually a benefit.

Re:State of Clojure 2020 by fishmaster on Friday February 21, 2020 @11:44AM (#22384484)
I don't understand how anyone can stomach Java, especially when Kotlin exists which has the same ecosystem as and better tooling than Java.
Re:State of Clojure 2020 by cutler on Friday February 21, 2020 @08:00PM (#22388636)
Unfortunately companies choose Java for conservative reasons which pretty much rules out anything like Kotlin making a dent in Java's mindshare. Most Java shops won't even upgrade beyond Java 8 so switching to Kotlin is a non-starter outside the Hacker News echo chamber.