9 ms·
What revolutionary exactly? Transducers?
by mapcars 10y ago
What revolutionary exactly? Transducers?
- grabcocque 10y agoTransducers 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?
- harperlee 10y agoI think a revolutionary aspect of it is not a technical one but a social one: is has destygmatized lisp a lot, and lots of people are jumping to it. Source: I played for a while around 2008 with common lisp and web apps, and while the tooling (hunchentoot, elephant, etc.) was solid, my completely subjective assessment was that the community languished and it was very hard for newbies. EDIT: Why was I downvoted? Explanations enable enhancement more than punishment... Is it for the reddit-like "source:"? I really dont get it.
- Sean1708 10y agoOne or two downvotes is just statistical noise, don't let it get to you.
- amelius 10y agoClojure may be revolutionary, but the fact that it can't be compiled to run on other runtime systems (e.g. Go) is a bit of a disappointment.
- sanxiyn 10y agoClojure can be compiled to run on other runtime systems. ClojureScript exists.
- amelius 10y agoYes, but all your tools and libraries break. You have to be prepared to exchange one ecosystem for another.
- harperlee 10y agoMmmh yeah but what is the alternative? To not have access to the JVM ecosystem? You could make an analogous argument for C not being portable, since it uses an ecosystem of tools and libraries that might not be portable to all systems.
- amelius 10y agoThe alternative is that the ecosystem itself is written in Clojure (or at least the most important parts of it). Of course, you will always have a set of points at which the language needs to call lower-level functionality, but you should keep that set as small as possible, to make the ecosystem easier to port. And in the modern "client/server" world, you really need this, because systems are often heterogeneous, and you often need to move one piece of code to another part of the system which runs on a different runtime.
- mapcars 10y agoCorrect me if I'm wrong, but ClojureScript is implemented from scratch and independently of "big" Clojure. If it is so - to run Clojure on other systems you have to implement everything, which makes no sense at all.
- hellofunk 10y agoClojure is an interesting intersection of two ideas: Lisp, and pure functional programming. It is not pure, but it is much closer to this than other lisps and it is immutable by default with efficient functional data structures. CL and Schemes are not this way.
- fmjrey 10y agoTo me the most important contribution of Clojure is to not focus on OO or FP at all, but instead on data. Data is a first class citizen of the language: data literal is part of its syntax, and it uses powerful persistent data structures behind that. Programming with Clojure is what has made me realise that data is really what matters after all. None of that FP or OO discourse should deviate us from that reality check that computing is all about data-in/data-out. Pull the plug and/or battery of your computer and see what remains next time you power it up. So yes, Clojure may not be revolutionary in itself, it does rely on the shoulders of giants. It is however setting a new standard in terms of being successful in bringing together a very well thought out set of features and philosophy to bring the focus of programming back towards the real complexity, instead of the accidental one created by how we think.
- hellofunk 10y agoThis is well said. I wrote Clojure full-time for a few years. I was lucky to do so and get paid to learn such an interesting language and paradigm of software development. Aside from the points you mention, of which I agree, there is one other point I took away from the experience that many would disagree with: I really, really missed static typing. So that's the main reason I don't use Clojure as much any more and went back to other languages with a different model of typing. But I learned so much and it changed the way I work in other languages.