
Worlds: Tabs for Programming by Alan Kay - pchristensen
http://www.windley.com/archives/2008/11/worlds_tabs_for_programming.shtml
======
twopoint718
I 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-...](http://gd.tuwien.ac.at/languages/scheme/tutorial-dsitaram/t-y-
scheme-Z-H-15.html) )

    
    
        `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
Amb 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.

------
pmjordan
Hmm, 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. :-/

------
brlewis
Interesting. It's program flow like with continuations and state management
like with SQL transactions.

~~~
apgwoz
Transactional Continuations. That sounds important.

------
MaysonL
pdf here: <http://www.vpri.org/pdf/rn2008001_worlds.pdf>

Originally posted here: <http://news.ycombinator.com/item?id=338271>

------
thomasmallen
I've been interesed in this as a way to safely modify core JavaScript
prototypes.

------
herdrick
I'm not sure how this isn't just describing a combination of functional
programming and dynamic programming.

------
babo
To 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.

------
ibsulon
It's been a while since I've coded in prolog, but that sounds a lot like what
they were trying to do.

------
Readmore
This is blowing my mind. The implications for AI and genetic programming could
be huge.

------
ph0rque
I am not a pedigreed programmer, but it sounds like git does this with
branching.

~~~
tdavis
Hardly 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.

------
jmah
pg showed this in On Lisp, chapter 22, Nondeterminism:
<http://www.paulgraham.com/onlisp.html>

------
dnaquin
Um. Threads?

~~~
apgwoz
No, because threads can mutate global state.

I would think this would be more like backtracking done in a side-effect free
way.

~~~
dnaquin
Threads _can_ mutate global state. They don't have to.

~~~
apgwoz
of course they _can_ and don't have to, but just using threads doesn't meet
the properties of the "world" construct.

