I've spent long nights meditating on this and I think I have a design that could work.
Commands are normal scheme expressions embedded in text, for example a post body of "Hello, number (+ 2 3)" would output "Hello, number 5". Literal parenthesis would need to be escaped with a backslash. All expressions are evaluated and their output displayed except for define expressions, which are both evaluated and displayed.
Each thread is roughly equivalent to a scheme session. Names defined in parent posts are available to subsequent posts in the thread. Names are immutable within a thread; symbols cannot be redefined.
Obviously a set of primitives should be provided: the basic arithmetic operations; a display operation; a set of formatting operations roughly equivalent in capability to today's BBCode; and, of course, our old friends cons, car and cudder.
>>2
The security issues wouldn't matter, since it would only be /prog/riders using the site and we would be to busy implementing web 1.0 monstrosities like <blink> in [b]Bbcode[/spoiler] to exploit it
>>1
That would be cool, though how would you store symbols like functions?
Name:
Anonymous2009-07-14 18:46
>>8
In the first iteration, just eval the whole thread each time it's rendered, keeping a table of name => expression mappings for functions and variables defined with define.
Name:
Anonymous2009-07-14 19:08
>>1
That the entire thread is a session is an interesting twist, though I'm not sure I agree with immutable names. If >>1 references post 1, what would (>>1) mean to you? I'm thinking something along the lines of PLT Scheme's modules, looking at (>>1) like (require "1.post"). In theory this could also reference other threads.
Name:
Anonymous2009-07-14 19:23
This could be cool if we integrated it with Google Wave
Name:
Anonymous2009-07-14 19:26
>>10
Mutable names would let the posters above you redefine + and maybe display. I guess that could be fun though.
I think (>>1) should display the content of post 1, though I'm not at all sure. Should ("hello") output hello or should it be an error? It'd be nice to do (b >>1), (rot13 >>1), (gpl >>1) and (faggot-quote >>1). Including other threads would be interesting. Some sort of library inclusion mechanism is needed I think.