A blog is born
Hello silent non-existent audience. Behold this here blog.
I knocked up the code for this a few months ago as an experiment with using
asynchronous callbacks in a semi-synchronous manner. Instead of providing a
callback for every AJAX call:
the function is wrapped in an *asynchronous wrapper* that returns a proxy which
can then be used immediately in many situations:
items = get_items(...);
There is a fair amount of hackery involved in getting it working, and it
provide operator overloading, so often simple things like addition or iteration
of results need to be moved into separate functions.
On the server side, you provide a list of functions that can be called, a la
remote procedure call. All the wrapping/unwrapping of data is handled
automatically (in PHP for now, but could easily be rewritten for any other
Even in its current form it's quite usable, and made building this single-page
blog site a snap. The biggest difference is that you can treat all data as
On the other hand, I'm not sure how much further the current approach can take
it. There are many traps to fall into when working with these asynchronous
functions, they're not at all easy to debug, and even harder to explain.
Probably the best way to go about this is to write a whole new language that
browser debug messages are useful) would be quite a challenge though.
Text formatting is courtesy of a PHP port of Markdown
, and the XML-DOM interface
(the server I'm running this on doesn't have PHP compiled in with