Thursday, June 02, 2005

Multi-stage web programming

Something languages like Links may want to keep in mind: there could be a great deal of benefit from taking a multi-stage approach. For the moment, let's make a simplifying (though utterly wrong) assumption that a web application lives in a single page. Then we can see three stages:
  1. The "runtime" is the dynamic aspect of a page that can be scripted with Javascript.
  2. Before that comes the page-generation logic that happens on the server side.
  3. Preceding both these phases is the generation of the static content (the "quoted" part of an ASP or JSP page).
Interestingly, all three of these stages have elements in common--specifically, the DOM. A unifying approach within a multi-stage language could be very powerful. For example, simply quoting an expression in this hypothetical high-level web development language would cause the compiler to change its output from some dynamic Javascript that, say, sets the innerHTML property of a DOM node, to JSP code that generates the HTML on the server.

But now reconsider the above assumption. Real web applications involve multiple round trips, and Ajax is popularizing the further complication of allowing semi-secret (let's never forget the back button, though!) round trips to occur within hidden frames. How does this cycle between the server and client sides change the multi-stage architecture?


單中杰 said...

Possibly related (no pun intended): It is popular to model (in particular, type) staged and distributed computations using modal logic, where ◻φ means "for every client, φ". In categorial grammar and other kinds of substructural logics, ◻ is often written with a superscript ↓ and paired with another modality ◇, such that ◇ and ◻ form a Galois connection; that is, ◇φ ├ ψ just in case φ ├ ◻ψ. Informally speaking, if ◻ means "for every client...", then ◇ means "for some server...".

Radley Co Tad said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

Unknown said...

You have discussed an interesting topic that every designer to know. Very well explained with examples. Spark interact is recruiting for 2018 check out the great new positions and apply online now Visit web design sydney and upload your resume.