5 ms·
Worlds: Tabs for Programming by Alan Kay
- brlewis 18y agoInteresting. It's program flow like with continuations and state management like with SQL transactions.
- apgwoz 18y agoTransactional Continuations. That sounds important.
- babo 18y agoTo coda that part in a side effect way is a critical part of this approach. It's easy to implement in Haskell where these are handled with trust or you need to do the hard work.
- pmjordan 18y agoHmm, sounds interesting, although I'm wondering if there's a significant difference to what immutable data structures together with STM provide - it certainly sounds very much like the transactions you can perform in Clojure, where, if certain conditions aren't met, all modifications are rolled back and you can bail out of your changes. If I had a degree in CS I'd probably even know the name for the difference between the techniques. :-/
- herdrick 18y agoI'm not sure how this isn't just describing a combination of functional programming and dynamic programming.
- dnaquin 18y agoUm. Threads?
- apgwoz 18y agoNo, because threads can mutate global state. I would think this would be more like backtracking done in a side-effect free way.
- staticshock 18y agowhich is called a continuation
- dnaquin 18y agoThreads can mutate global state. They don't have to.
- apgwoz 18y agoof course they _can_ and don't have to, but just using threads doesn't meet the properties of the "world" construct.
- ggruschow 18y agofork(2) will do though.
- apgwoz 18y agobut, then you need to add some sort of IPC to the mix, because there's still a notion of "commit" for the mutation of state.
- ggruschow 18y agoI don't think you need it in all cases. For instance, if the "world" / "tab" knows that it's no good, it could self-exit. That'd leave only the "good" one standing without any coordination / communication. Or, in some other cases, return codes may be good enough. Even if it's easily possible with current stuff though, it's still an interesting idea.
- ph0rque 18y agoI am not a pedigreed programmer, but it sounds like git does this with branching.
- deleted 18y ago[deleted]
- tdavis 18y agoHardly git exclusively; most any modern version control works well for this. Git's local branching/checkout makes it a slightly faster process though, I suppose.
- ibsulon 18y agoIt's been a while since I've coded in prolog, but that sounds a lot like what they were trying to do.
- Readmore 18y agoThis is blowing my mind. The implications for AI and genetic programming could be huge.
- twopoint718 18y agoI thought I remembered the 'amb' operator sounded similar. It is discussed in "Teach Yourself Scheme in Fixnum Days." From chap 14 ( http://gd.tuwien.ac.at/languages/scheme/tutorial-dsitaram/t-y-scheme-Z-H-15.html http://gd.tuwien.ac.at/languages/scheme/tutorial-dsitaram/t-... ) `amb` takes zero or more expressions, and makes a nondeterministic (or ``ambiguous'') choice among them, preferring those choices that cause the program to converge meaningfully. Here we will explore an embedding of amb in Scheme that makes a depth-first selection of the ambiguous choices, and uses Scheme's control operator call/cc to backtrack for alternate choices.
- visitor4rmindia 18y agoAmb is implemented using continuations and so the problem of side-effects remains. If we don't consider side-effects then "tabs" just degenerates into "continuations". EDIT: Maybe tabs == "monads" + "continuations"? I don't know enough about haskell to tell.
- MaysonL 18y agopdf here: http://www.vpri.org/pdf/rn2008001_worlds.pdf http://www.vpri.org/pdf/rn2008001_worlds.pdf Originally posted here: http://news.ycombinator.com/item?id=338271 http://news.ycombinator.com/item?id=338271
- thomasmallen 18y agoI've been interesed in this as a way to safely modify core JavaScript prototypes.
- jmah 18y agopg showed this in On Lisp, chapter 22, Nondeterminism: http://www.paulgraham.com/onlisp.html http://www.paulgraham.com/onlisp.html