Tuesday, January 12, 2010

risp language concept...

Too tired to finish this, but this is hopefully going to be a simplified LISP/scheme with functions as objects with implicit continuations. I have a feeling there's profound stuff in here that I'm just too tired to reach, but I don't wanna lose this. Sorry about the incoherence. ;)

Risp Is a Small lisP.

everything is a list
all objects are immutable and reference counted - copy-on-write?
lists can have different cell sizes - 8/16/32/64-bit

functions have one parameter but multiple runtime states. function states are mutable.

for instance - divide:
• first load sets up base
• repeated loads do the divides

(func divide
(local value)
(= value $)
(/ value $)

functions don't end unless you say they end - they just automatically break/hold at the end of the list.

func list:

• name
• local variables
• run [1..x]

goto lets you jump between runs. don't know how to label them.

'up' keyword pushes a value into the return list.

(func addall
(local v)
((+ v $) (up v))

$ is the single parameter. handling multiple parameters is done via staged/multiple calls, you can set up multiple locals that way easily and do the heavy/repeated lifting with a later state.

(func gimmestuff
(local myaddall addall)
(myaddall 1 2 3 4 5)
(myaddall 6)

(def catcher (= gimmestuff)

= (may change) can "catch" up statements and build a new list.

you can have functions that run functions and as long as there's no active catching statement, it's returned to the next parent. if there's no parent that can receive it, it is caught by /dev/null. ;)

my 'data-function identity' - executing (variable) = (func variable (local value) (up value)) in other words a non-function variable pushes itself up when run. therefore everything is executable.

No comments: