4 ms·
Transducers and Spec are two great examples of what Clojure's community is best at. There's a practicality of purpose and single mindedness of philosophy at pla
by grabcocque 10y ago
Transducers and Spec are two great examples of what Clojure's community is best at. There's a practicality of purpose and single mindedness of philosophy at play in the language's evolution here. Making simple easy.
To my mind though, Clojure brought clarity to the JVM on issues of concurrency, state, mutability, object orientation and persistence and for that I will always love it.
- fnordsensei 10y agoIt's also spawned the recent interest in immutability. Via Om it's had a considerable effect on how Facebook has developed React and its ecosystem, for example.
- pjmlp 10y agoTransducers were already in Common Lisp in 1989, https://www.reddit.com/r/Clojure/comments/3tha86/transducers_in_1989/ https://www.reddit.com/r/Clojure/comments/3tha86/transducers... Likewise Spec ideas are not new to old timer Lispers, many forms of Lisp type annotations are similar to it. What Clojure has brought was making those ideas "modern" again.
- pron 10y agoIsn't the idea that all mutation must either be local or transactional rather revolutionary? In a sense, Erlang is like that, too, but Clojure took the idea much further. It is pretty clear that that's Clojure's the main idea.
- pjmlp 10y agoNo, because those ideas can be tracked down to Miranda or even early probably, when digging into enough SIGPLAN papers. What might be revolutionary is making more "common programmers" aware of them.
- pron 10y agoIsn't Miranda pure-functional? Because Clojure is imperative (-functional). Saying you can't mutate is very different from saying you can mutate whatever you like, whenever you like, as long as its transactional or not observable. And SIGPLAN papers don't really count. A revolutionary product is not the same as a revolutionary idea. Implementing ideas that have never been productized is still revolutionary.
- jerf 10y agoErlang is a fully immutable language. Haskell's more the one where things are either immutable or strictly contained in some scope.
- pron 10y agoIf I'm not mistaken, ETS tables allow the same kind of mutation as Clojure's atoms -- i.e., they are atomic, but still mutations. Haskell is pure-functional, which is something very different from the functional-imperative Clojure and Erlang.
- jerf 10y ago"If I'm not mistaken, ETS tables allow the same kind of mutation as Clojure's atoms" ETS tables are usually out-of-(Erlang-)process. You are sending messages to them to update them and query them, and those processes are each functional, so it's still functional. IIRC there's a mode where it runs "in process" with you, but it's still conceptually behind the same interface. (Which raises interesting questions about what exactly is "mutable" or "not mutable", which IMHO ultimately get best answered by Rust.) What Erlang is not is pure. You can query an ETS table, send it a command to mutate, then run the exact same query again and get a difference response. The message passing makes things impure, even though every individual component of the system is immutable-functional. And there are some other impure functions in Erlang as well, of course, like the functions to get the current time, but the message passing is in some sense the fundamental introduction of impurity at the architectural level.
- pron 10y ago> The message passing makes things impure, even though every individual component of the system is immutable-functional. That's how you think about it, but allowing mutation and allowing blocking interaction with processes are exactly the same, as blocking interaction with processes is the same having as continuations, and continuations alone are all you need for mutation, even if you imagine things to be immutable. Like monads, continuations are a universal effect. An otherwise pure language with continuations is indistinguishable from an imperative language, i.e., it is imperative. Both Clojure and Erlang are functional-imperative languages, but unlike other imperative-functional languages (like ML), they have been designed with concurrency in mind, and the mutations they support are transactional (or at least atomic(.
- eternalban 10y ago> Clojure brought clarity to the JVM on issues of concurrency, state, mutability, object orientation and persistence Hyperbole much?