Not to take anything away from Rich's wonderful presentation, but Chapter 3 of SICP covers a lot of this with great clarity and in depth, specifically the OO and functional nature of time and associated subtleties (SICP does not deal with persistent data structures etc). It needs some deep thinking and slow and careful reading to understand all the implications (most students rush through these sections imo), but it…
Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
21–30 of 46 posts
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#22Not to take anything away from Rich's wonderful presentation, but Chapter 3 of SICP covers a lot of this with great clarity and in depth, specifically the OO and functional nature of time and associated subtleties (SICP does not deal with persistent data structures etc). It needs some deep thinking and slow and careful reading to understand all the implications (most students rush through these sections imo), but it…
I downloaded a copy of SICP last week, and I was thinking about that chapter as I read this presentation. I haven't had a chance to give that section full attention yet, but have the ideas expressed there had much influence on language design? Is Rich's presentation representative of some ideas more advanced than that section of SICP? Or has it been largely ignored over the decades?
yes!
Every imperative(I include OO in "imperative" here) language that allows local computational state, and every functional language trying to maintain referential transparency (and everything in between) embody those ideas, so yes the ideas of dealing with time in computation by local state, streams, pure functions etc are influential in all language design.
"Is Rich's presentation representative of some ideas more advanced than that section of SICP?"
This is a vague question, (what exactly do you think is "more advanced"? ), but to (try to) answer it, (imo) No, not really, not at the level of ideas.
Haskell or Erlang is, for example, as advanced, in terms of ideas, (or more advanced, depending on your pov) than Clojure, for e.g
Where Rich has done great (,brilliant!) work is to turn these ideas (and others- see his bookshelf!-,e.g many from lisp, e.g meta programming with macros) into a workable, practical, and beautiful language which interoperates with tonnes of existing libraries.
The combination of deep theoretical insight and a ruthless focus on practicality is what (I think) makes Rich Hickey unique.
The one aspect of Rich's talk not covered is SICP is the use of persistent data structures, but if you have worked through SICP, you'll instantly understand why this is a great solution and what the potential tradeoffs are.
The problems (and advantages!) of state in programming languages and its interwining with time (and therefore concurrency) is clearly laid out in SICP Ch. 3. (Eg. Section 3.4 is titled "Concurrency: Time is of the essence", 3.4.1 is "The Nature of Time in Concurrent Systems" while the language is very clear, it needs repeated reading and deep thougt (imo) to get a good grip on the ideas).
Every functional language(e.g Haskell) deals with the "functional" view of time. Every language that allows modelling of local state and loss of referential transparency(all imperative and OO languages afaik) choose the "other path" (some would say the dark side!) of dealing with time in computation.
Let me repeat, my post above was not claiming that Rich's talk is valueless or that he is only repeating what SICP said.
My point was (only) that a good understanding of Chapter 3 of SICP would be a great background to understanding this talk. Eg: You will understand exactly what he means by OO needing to "stop the world", even without seeing the details on the succeeding slides.
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#23While I haven't had the opportunity to watch the talk, those slides are fantastic. I think the key to Rich's ideas is to realise them on non-volatile storage. This could revolutionise filesystems and databases.
http://www.mail-archive.com/tux3@tux3.org/msg00035.html
I assume that all "snapshotting" filesystems (NetApp, ZFS) have a similar structure?
Edit: ah, tux3 is alive: http://tux3.org/, it was tux2 which was quashed. Cool.
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#24Time is a global variable (and hence an implicit parameter) to any function that manages state.
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#25I just wish all the good things were a little bit more memory efficient. Maybe we're getting there eventually...
That's the idea of Clojure's persistent data structures. Values share the parts of themselves which haven't changed, so they are not copied. "All of the Clojure collections are immutable and persistent. In particular, the Clojure collections support efficient creation of 'modified' versions, by utilizing structural sharing, and make all of their performance bound guarantees for persistent use." http://clojure.org/dat…
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#26Earlier quoted context omitted.
That's the idea of Clojure's persistent data structures. Values share the parts of themselves which haven't changed, so they are not copied. "All of the Clojure collections are immutable and persistent. In particular, the Clojure collections support efficient creation of 'modified' versions, by utilizing structural sharing, and make all of their performance bound guarantees for persistent use." http://clojure.org/dat…
I know. I read Stu Halloway's book and I read some articles about how the persistent data structures work. But I also did some tests myself. Performance isn't great but that's not so much the issue for me. Memory use is a problem though. I can't have a list of a million integer pairs take 160MB of RAM.
Calling (transient x) gives you a mutable copy of x which is created in O(1) time. You can then use functions like conj! and assoc! to modify the data structure in place. When you've finished, call (persistent! x) which returns you to a pure data structure (another O(1) operation).
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#27His observations on the conflation of identity/state/value in OO are very insightful (and I agree with them with the reservation that they apply nearly equally to simple structs of non-OO languages, as well). But the conclusions drawn seem to be yet another attempt at deriving a paradigmatic model (of reality) that is "simplistic" (to borrow his critique of OO). If the object is now to graduate to subject -- a fine i…
If the object is now to graduate to subject -- a fine idea -- then we should remember that sentient modality of being includes repose, as well as action. Now there's a sentence that gives me a grad school flashback! What on earth (if not the fuck) is the "sentient modality of being"?
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#28Earlier quoted context omitted.
That's the idea of Clojure's persistent data structures. Values share the parts of themselves which haven't changed, so they are not copied. "All of the Clojure collections are immutable and persistent. In particular, the Clojure collections support efficient creation of 'modified' versions, by utilizing structural sharing, and make all of their performance bound guarantees for persistent use." http://clojure.org/dat…
I know. I read Stu Halloway's book and I read some articles about how the persistent data structures work. But I also did some tests myself. Performance isn't great but that's not so much the issue for me. Memory use is a problem though. I can't have a list of a million integer pairs take 160MB of RAM.
This doesn't have much to do with sharing. Rather, it is the overhead of boxing the integers.
If you want a byte array that you'll interpret as an array of machine integers (as an int * would be in C), then you need to use that type instead of a "list of integers" that your language provides. That "list of integers" is optimized for something other than space (integer math not overflowing, O(1) insertions, etc.). Conversely, arrays of machine ints have many annoying quirks, but the underlying hardware can process them really quickly, and they are very frugal with respect to memory use. (No overhead, basically.)
As it stands now, most language implementations are not smart enough to see that you just used lists because you like the syntax, but meant to use byte arrays. (Or, you used Integers instead of ints.)
Tracemonkey, GHC, and probably other languages have code to help optimize this case. dons wrote a nice article about how GHC's codegen produces code that uses unboxed types even though the programmer used boxed types.
As far as I know, Clojure is not really smart enough to optimize much right now (beyond the JIT that the JVM does), so this is probably a problem. The solution is to fix Clojure or to use the native types. I don't know how to do this, as I don't use Java or Clojure, but it sounds like a Simple Matter Of Programming to expose a shared array of unboxed integers. (There are a lot of papers on this.)
Functional programming is a "new idea" in terms of people using it for "Real Work", so there is a long way to go in terms of writing excellent optimizing compilers. It is getting better very quickly, though.
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#29Earlier quoted context omitted.
I know. I read Stu Halloway's book and I read some articles about how the persistent data structures work. But I also did some tests myself. Performance isn't great but that's not so much the issue for me. Memory use is a problem though. I can't have a list of a million integer pairs take 160MB of RAM.
I can't have a list of a million integer pairs take 160MB of RAM. This doesn't have much to do with sharing. Rather, it is the overhead of boxing the integers. If you want a byte array that you'll interpret as an array of machine integers (as an int * would be in C), then you need to use that type instead of a "list of integers" that your language provides. That "list of integers" is optimized for something other tha…
But if I put lots of structs in a Java ArrayList, memory use goes down significantly, so clojure vectors are much less efficient regardless of boxing.
Re: Rich Hickey's Keynote: A deconstruction of object-oriented time [pdf]
#30Earlier quoted context omitted.
I know. I read Stu Halloway's book and I read some articles about how the persistent data structures work. But I also did some tests myself. Performance isn't great but that's not so much the issue for me. Memory use is a problem though. I can't have a list of a million integer pairs take 160MB of RAM.
There was some work recently to improve the performance of persistent data structures. See http://clojure.org/transients Calling (transient x) gives you a mutable copy of x which is created in O(1) time. You can then use functions like conj! and assoc! to modify the data structure in place. When you've finished, call (persistent! x) which returns you to a pure data structure (another O(1) operation).