Friday, September 19, 2008

A Question of Ajax

So I've reached the point in Mipper, my Mips interpreter, that I'm constructing the website; indeed, I've reached the point in constructing the website where I have to decide just how to connect the server-side Mips interpreter, to my client-side UI. The obvious choice is Ajax... but just how much Ajax is the right amout of Ajax.
What I need to do is allow the Mips proggies to execute on the server side, where my pythonic interpreter lives (I'm unwilling to port it to javascript to run on the browser: I like it fine where it is), while somehow getting the output and register and memory changes updated to the browser. This task would be simple enough (just send the data over) if I had infinite bandwidth and a fiber optic cable, but I don't. I can only update the client side gui infrequently unless I want to overload my connection: imagine me sending data for every iteration of a tight loop. Not gonna happen!
What I decided I need to do, is exactly what debuggers like eclipse do: offer two modes, step and break. In break mode, the ui only stops and updates when you reach a breakpoint in the code. Step mode would be the interpreter executing one instruction at a time, per user request. Both these solutions would be relatively light on the bandwidth while at the same time giving the user the information that they need. And indeed, I think I'm going to implement these two options and have that be the way of it. I might in the future consider porting my pythonic interpreter to javascript, but for now it's just redundant time wasting. I have to get this project finished or else I'm never going to be able to concentrate on my school work.
Which brings me to my final point: I'm neglecting my school work for programming. Like an irresponsible pair of lovers, skipping class to make out in the dark, me and my project are neglecting our friends and our obligations. But once I've finished with it, oh what accomplishment! The website already looks great; I got a template off www.owsd.com called missunderstood that looks great.
Django has been a pleasure to work with. It has less magic than rails, but I think that is a good thing. Rails is often too behind-the-scenes; sometimes I want to be able to see what is going on. It gets to the point with rails, for me, that I don't even feel in control of the app anymore. But I really shouldn't say that now; I was less experienced when last I used it for anything. When next I come back to it, then I'll pass my final judgement.
For the client side behavior, I'm using a combination of JQuery (for DOM manipulation) and Ext for sexy user interface. Only the actual Run-the-Code part of the app relies on Ext. The rest is standard xhtml and css. Truly I don't like the ultra-scripty websites that're wannabe desktop apps; so called thick-rich-webapps. Discretion please. The web is supposed to look like the web.

0 comments: