4 ms·
Never used Lisp, but huge Clojure user, the real innovation is the immutable data structures: RICH HICKEY: Ok, so, problem number one on that list was place or
by dustingetz 8y ago
Never used Lisp, but huge Clojure user, the real innovation is the immutable data structures:
RICH HICKEY: Ok, so, problem number one on that list was place oriented programming. Absolutely, this is the problem. Almost all the programs I wrote, lots of the things on that list were multi-threaded programs, you know, they're crazy hard in C++. Just impossible to get right, when you adopt a normal mutability approach, you know, mutable objects. So, this is the number one self-inflicted programming problem. It seemed, you know, clear to me that the answer was to make functional programming and immutable data the default idiom. So the challenge I had was, were there data structures that would be fast enough to say, "we could swap this for that". And the objective I had, the goal I had was to get within 2x for reads and 4x for writes. And I did a lot of work on this, this was actually the main research work behind Clojure, was about these persistent data structures. Eventually I found...you know I looked at Okasaki's stuff and, you know, the fully functional approach and none of that gets here. And then I found Bagwell's structures were not persistent, but I realized could be made so, and they just have tremendously great characteristics combining the persistence with the way they're laid out, the way memory works. They made it. They made this bar, and I was able to get my friend to try my programming language. You know, we (?) have large library of pure functions to support this, and, you know, immutable local bindings. Basically if you fall into Clojure, your first hurdle is not the parentheses, right? It's this, this functional paradigm, everything is gone, there's no mutable variables, there's no state, there's no mutable collections and everything else, but there's a lot of support, there's a big library. You just have to, you know, sort of learn the idioms. So I think this was straight-forward, the critical thing that's different about Clojure is, by the time I was doing Clojure, the people who invented this stuff had adopted a lot more, right? I think most of the adherents in the functional programming community considered functional programming to be about typed functional programming, statically typed functional programming is functional programming. And I don't think so, I think that this is, you know, this falls clearly in the 80/20 rule. And I think the split here is more like 99/1. The value props are all on this side, and I think Clojure users get a sense of that, they get a feel for that. This is the thing that makes you sleep at night.
https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/EffectivePrograms.md https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
- reitzensteinm 8y agoI would go as far as to say that a language with more traditional syntax (for instance Python style) with pervasive immutable data structures would do very well. Few of the benefits Clojure brings to day to day development seem to require a lisp syntax.
- dustingetz 8y agoMaybe – s-expressions have a killer app though, which is that they are so simple that the level of effort to port Clojure to other platforms (ClojureScript, Clojure CLR, etc) is within reach of one person. I am irrationally bullish on Clojure, but this is the key to the bet – platform reach has network effects which I believe may outweigh in longrun the resistance to alien syntax. My Clojure codebase (http://www.hyperfiddle.net/ http://www.hyperfiddle.net/) runs on JVM, node, browsers, lambdas, and inside Datomic cluster as stored procedure. Same code! Same library artifact! Simultaneously targeting all these different platforms!
- reitzensteinm 8y agoAll platforms could share the same syntax->s expression desugaring code, so I'm not sure why that would matter. The difference Clojure has is that the core language is tiny, but you could do this with an alternative syntax as well. You'd just need macro support, even if they're more clumsy to write. (I literally have an editor open working on a Clojure compiler as I write this, so I don't disagree with your premise).
- drcode 8y agoI'm definitely as hardcore of a clojurist as you can be, but I would NOT call myself "bullish" on clojure: Certainly, for those of us familiar with the language it's an awesome tool, but clojure definitely is not the "hot new thing" anymore and new user adoption I think is declining in recent years, for reasons that have little to do with intrinsic properties of clojure.
- dustingetz 8y ago