News for hackers. Stuff that matters.
Re:Clojure Turns 15 panel discussion video by bcrosby95 on Monday February 13, 2023 @02:40PM (#34779119)
If you want an easy win, one thing Rich mentioned in a talk is - if he had to do Clojure all over again today - he would put transducers at the 'bottom'. For data transformation this makes the underlying collection type largely immaterial.

> real structs

I'm not even sure if value types are conducive towards immutable, persistent data structures. I'm certainly excited for project Valhalla but I'm not sure if Clojure, nor any Clojure-like JVM language, written in an idiomatic fashion, would really benefit from it.

> light-weight concurrency like Go

Project loom is already in preview mode. Lightweight concurrency is practically here for any JVM language, and once it's fully released I will likely have zero reason to use core.async.

> type support

Static typing is A Thing you can choose to do, but I doubt you would get many daily Clojure users agreeing that it is "better". I think it's different and better in some circumstances but not necessarily others. It definitely feels trendy these days, sorta like how dynamic typing felt trendy 15 years ago.

One of the things I find most interesting is that the Clojure community seems very interested in a "Clojure everywhere" style of doing things: you have Clojure, ClojureScript, Babashka, deps using edn, build using Clojure source, etc. But at the same time, perhaps for historical reasons, they lean into heavy interop with the underlying ecosystem - it was a big reason why Clojure was able to become as widely adopted as it has been, and it's also a big reason why the language itself will never really hold you back despite being a niche one (you can always rely on a Java library, etc.).

Re:Clojure Turns 15 panel discussion video by fiddlerwoaroof on Monday February 13, 2023 @03:08PM (#34779572)
Yes on the type support not really attracting Clojure users. If you wanted to enable better refactoring, the thing to do would be to take more pages from other lisps and use the compiler to add more metadata to the runtime (in development mode at least) so that you can get better tracking of the language constructs.
Re:Clojure Turns 15 panel discussion video by hota_mazi on Monday February 13, 2023 @09:25PM (#34784393)
Clojure users fighting against static typing are on the wrong side of history. They are fighting a side for all the wrong reasons, and they will lose.

There is a reason why all dynamically typed languages today are scrambling to add some form of static typing to their language, but never the other way around.

Static typing does everything dynamic typing does, but better, faster, allow automatic refactoring, faster programs, better navigation, better documentation, better maintenance.

Re:Clojure Turns 15 panel discussion video by epgui on Monday February 13, 2023 @09:51PM (#34784614)
I also believe the same thing.

However, to be fair, Clojure's response to types is `org.clojure/spec.alpha`, and if you give it a really good chance, you'll see that it brings a lot to the table.

It doesn't change that I believe strong typing (a Haskell or Idris/Agda-like flavour of it) to be the future, but what it did change was how I thought about type systems and how to write and test programs.

Re:Clojure Turns 15 panel discussion video by blevin on Monday February 13, 2023 @09:56PM (#34784656)
Or maybe it isn’t a war, there isn’t anyone fighting, and there’s nothing to be lost.
Re:Clojure Turns 15 panel discussion video by chitowneats on Tuesday February 14, 2023 @12:46AM (#34785891)
I understand the point you're making, and that you wanted to make it dramatically. I got a nice belly laugh thinking about my future grandchildren chastising me for forsaking static types:

"All your life's work for naught, pepaw. If only you had been on the right side of history".

I do have a substantive disagreement with this statement: "There is a reason why all dynamically typed languages today are scrambling to add some form of static typing to their language, but never the other way around".

Languages like C#, Java, Scala, and Typescript all have all adopted some degree of type inference. Their users wanted it for a long time. To begin with, none of these languages are anywhere near as strictly-typed as a language like Haskell. Clearly even developers on "the right side of history" don't want to maximize static type checking in all cases, so the issue is not as cut and dry as you make it sound.

Re:Clojure Turns 15 panel discussion video by johannboehme on Tuesday February 14, 2023 @06:22AM (#34787915)
You are wrong. https://www.youtube.com/watch?v=YR5WdGrpoug Static typing only leads to devs trying to press the real world in stupid arbitrary categories.
Re:Clojure Turns 15 panel discussion video by yladiz on Tuesday February 14, 2023 @10:58AM (#34791227)
Yeah and spec isn’t trying to press the real world into arbitrary categories? /s

The thing is, having some structure in terms of types or data shape constraints helps you model and understand your program. You can change them as your understand of your program changes or the need arises. You can be against static types because they force you to slow down and think about things before you can just get to coding, and it can be sometimes annoying to model your system using them (and sometimes not so useful), or other technical reasons like some type systems don’t allow you to model certain things, but to say it just leads to devs putting the real world into stupid, arbitrary categories when the real world (and your program!) primarily have data that can be trivially categorized because that’s what Rich Hickey said makes you sound like cargo-culting or parroting a point without diving deeper into the specific reasons and potential counterarguments.

Re:Clojure Turns 15 panel discussion video by goldrake on Tuesday February 14, 2023 @03:40PM (#34795628)
IMHO, external schema to validate structures at entry point is the way to go.

We have to have both: types and external schemas in oo languages.

Plus, types make working with maps cumbersome and force you to maybe unnecessary data cages called dto-s