Very cool. I was just looking for other Seaside-style web frameworks today. The "natural style" mode in Tir is just like the main way to build web apps in Seaside.
Aside from Lua and Smalltalk, what other languages could host this kind of framework? I know Ruby 1.9 has Wee, but that doesn't seem to be "ready for prime time."
In its early stages it was continuation-based, but now it's just regular ol' closures. You can still use continuations rather easily though; some of it is modeled on the PLT stack (send/suspend, etc.).
Code written in the continuation monad (i.e., simple imperative style) can be translated to an Automaton arrow and fit into a Haskell on a Horse application. This approach has the advantage of type-safety and greater composability.
The main feature that is required is the ability to callcc and/or coroutine yield from any point in the stack. If you look at Wee, the user of the framework has to callcc all over the place to make it work. In Tir I have web:prompt(), which itself does the yielding without anyone having to care.
The significance of this is that Tir can provide one API for all three styles without special effort from the user.
Comments
Very cool. I was just looking for other Seaside-style web frameworks today. The "natural style" mode in Tir is just like the main way to build web apps in Seaside.
Aside from Lua and Smalltalk, what other languages could host this kind of framework? I know Ruby 1.9 has Wee, but that doesn't seem to be "ready for prime time."
I've been toying with something similar in Atomo (running atop mongrel2): http://bitbucket.org/alex/web/src/2a90b9bd6322/example.atomo
In its early stages it was continuation-based, but now it's just regular ol' closures. You can still use continuations rather easily though; some of it is modeled on the PLT stack (send/suspend, etc.).
Earlier progress: https://gist.github.com/717381/433d743dc4a7d91705692ff1dc6ca...
Source code: http://bitbucket.org/alex/web/src
Code written in the continuation monad (i.e., simple imperative style) can be translated to an Automaton arrow and fit into a Haskell on a Horse application. This approach has the advantage of type-safety and greater composability.
You can also find continuation-based web frameworks in Common Lisp and Scheme.
http://common-lisp.net/project/cl-weblocks/
http://common-lisp.net/project/ucw/
http://docs.racket-lang.org/web-server/
For Perl based solution have a look at Continuity (http://search.cpan.org/dist/Continuity/).
I have posted some Continuity code here before (see http://news.ycombinator.com/item?id=1686177 & http://news.ycombinator.com/item?id=1006071).
Also check out Squatting (http://search.cpan.org/dist/Squatting/) which is a RESTful MVC micro framework which (by default) sits on top of Continuity.
The main feature that is required is the ability to callcc and/or coroutine yield from any point in the stack. If you look at Wee, the user of the framework has to callcc all over the place to make it work. In Tir I have web:prompt(), which itself does the yielding without anyone having to care.
The significance of this is that Tir can provide one API for all three styles without special effort from the user.
A "How it's made" blog post would make an awesome next article!
Nagare (http://nagare.org) for Stackless Python