The Weblog » 2008 » August

Halting Problem

The Weblog

Part of Roland Sadowski's website

August 31st, 2008

MathTalker Went Live

On friday I uploaded the 1.0 version of MathTalker to Google’s servers. It’s a simple chat application which allows you to write mathematical formulas (using syntax similar to TeX). It was written in Python and runs on App Engine.

MathTalker has pretty steep requirements for a web app: Firefox browser and special math fonts (download links on MathTalker page). Displaying math formulas is possible thanks to ASCIIMathML library, which converts ASCII to MathML. I know about the plug-in that lets you render MathML in IE, but I decided to drop support for that browser after spending a couple of hours trying to make the UI work.

App Engine

App Engine SDK comes with a little web framework and that’s what I used. You can also use Django, but I wanted to keep things simple. The built-in framework is nothing special, but it doesn’t get in your way. What requires more attention is Google’s Datastore - their distributed database. Honestly, I used only relational databases so far (oh, and flat files…), so I had to watch one or two talks from Google IO conference to get the idea.

What pissed me off the most was lack of support for nested transactions and some bugs in existing transaction code. To run some piece of code, you have to pass a function to db.run_in_transaction(), but whenever I tried to make the code more generic (as in: not to write two almost identical functions) stuff exploded. It’s pretty bad, because creating an entity and updating a counter should be a single atomic action. But they aren’t, so you end up hoping for the best.

JavaScript

Little bit of history: At first I hated it, then I really liked it. Now I’m just using it and ignoring its deficiencies. And regarding the period that I liked JS: it was the time that JS libraries were becoming really, really good, and I was just impressed (shocked, even) that it’s possible to build anything with it without cursing like mad.

But even JS 1.7, which has generators and list comprehensions, is pretty verbose, and you can only take it so far as jQuery - the best attempt for creating domain specific language in JavaScript. Great for traversing/manipulating DOM.

Another thing: I used Emacs with js2-mode. The style of formating code encouraged (somewhat) by jQuery drives Emacs insane and beaks the indentation. At the beginning it bothered me, but then I stopped nesting function definitions and js2-mode let me do my work, and my code looked more readable. I don’t know if that was how js2-mode supposed to work or if it was just a bug, but it’s done more good than harm.

Blueprint

I’ve also tried out Blueprint CSS framework. I’ve used Yahoo’s CSS reset library before (and I don’t want to work without CSS reset ever again), but never Blueprint. It’s pretty good, but somehow feels not clean enough. I guess it provides to much defaults for my taste. But I’ll probably use it again someday.

§