[Wheat-developer] AJAX
Status: Pre-Alpha
Brought to you by:
mark_lentczner
From: Mark L. <ma...@gl...> - 2005-04-14 17:20:32
|
There has been lots of rumbling around the web about AJAX. After all, after anyone has played with Google Maps, why would anyone want to go back? In addition, talks with Rohit Khare, Donovan Preston and Kragen Sitaker have explored how best to build richer applications with systems like Wheat and Nevow. One set of ideas centers around how, if you delegate part of your page to another object: tt-foo(): { #expand(subject: #subject.sub-thing) } That this expansion could be migrated to take place in the client (!). In fact, as that object, through its templates interacts with the user, all of that interaction might take place inside the already loaded page. What is most interesting to me about this is that I think it can be done in a way that is very clean to the programmer, and degrades to normal round trips when the browser can't handle it. Meanwhile I've been thinking crazier thoughts: Moving part of the application to the client is a pain: The language is different (JavaScript), the environment different (the DOM, or rather the intersection/union of various DOM implementations), and programming metaphor a total switch (from the data objects themselves to once again essentially procedural coding based on the UI). What if... What if we ran Wheat in the client? Really! Treat the per-client state, that we'd rather keep on the client (rather than in the session), as a Wheat tree of objects rooted at the client. Treat interaction between client and server as interaction between Wheat objects in different trees (though all rooted in the same, global Internet tree!) And since a client based Wheat implementation wouldn't need all the fancy mount point stuff, I think an implementation wouldn't be that hard in JavaScript (!). As for compiling methods we could either 1) write an interpreter in JavaScript (there are only, what 16 bytecodes)?, or 2) compile to JavaScript! Okay, okay, this is getting rather ahead of ourselves..... But it is a curious idea, no? - Mark |