Wed Mar 19 12:22:24 EDT 2008

the scat machine model

all scat functions take a data stack, and a hidden parameter used to
implement any hidden data that bypasses the computation. the reason
for implementing it like this is that the code operating on the data
stack (the SCAT langauge) is orthogonal to extensions that implement
hidden state.

the reason that the pure functions ALSO pass this state around is to
avoid the problem of lifting pure functions to state passing
functions. if purity is desired: simply do not pass any interpretable
state into a computation. to check purity: pass something that can
only be interpreted locally (checks read), and check if it's the same
when it comes out (checks write).

why is hidden state necessary? anything can be solved with
combinators, but for some problems, bypass can be be a tremendous
simplification. relate this to:

  * lexical variables (bypass trough random access in environment)
  * monads (bypass bookkeeping implemented by 'bind' and 'return')

functions can then be classified into 3 groups that do

   1) not know about state (define-word).
   2) know about state, but merely pass it on (define-control, make-state)
   3) modifications on the state data (like 2, but with data accessors)

i'd like to clearly separate 2 and 3, but see no way to do now other
than giving group 2 no means to interpret the data, and require
functions in group 2 to never replace the data. the latter could be
guaranteed with an assert, the former is namespace management.

i'm done ;)