Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"the core JDK package java.util.concurrent includes CopyOnWriteArrayList and CopyOnWriteArraySet which are persistent structures, implemented using copy-on-write techniques...Fully persistent collections are available in third-party libraries"

https://en.m.wikipedia.org/wiki/Persistent_data_structure#Ja...

So if you need that in Java you can simply use 3rd-party libraries like https://pcollections.org/ or https://github.com/GlenKPeterson/Paguro.

There is no need to completely change your programming language to Clojure and suffer from all that readability issues: https://softwareengineering.stackexchange.com/questions/1972...



There's a huge difference in friction between using a language that _also_ has a library for persistent data-structures, vs a language that was designed _around_ immutable datastructures.

If you had brought up error messages in Clojure as your main concern, I'd think you'd have a point, but the "putting the paren before the function name confuses me" argument is as old as lisp and pretty moot imnsho.

I did Clojure full-time for years, and now do Rust rust full-time, and I can definitely say that Rusts syntax is wayyy more complex and hard to read, despite technically being in the C style syntax family.

    Great minds discuss architecture, Average minds discuss semantics, Small minds discuss syntax
It's also not like the example you posted is easier to read in e.g. javascript if you remove all indentation.

    (defn f [{x :x y :y z :z [a b c] :coll}] (print x " " y  " " z " " a " " b " " c)) 

    const f = ({x: x, y: y, z: z, coll: [a, b, c]}) => print(x, " ", y, " ", z, " ", a, " ", b, " ", c)


I compared Clojure with Java and see no advantages for using Clojure instead of Java on the JVM. Your examples comparing Clojure with Rust or Javascript are not of interest in that discussion. Both Rust and Javascript are used for completely different use cases than Clojure and Java.


    (I) see no advantages for using Clojure instead of Java on the JVM
To be blunt, I think that says more about you than it says about Clojure. A good engineer should always see the tradeoffs.


Indeed. There are also of course persistent data structure libraries for many other languages, but it's a huge difference when they are the core vocabulary of the language and its culture.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: