Sunday, September 21, 2008

Javascript performance optimization with jeene

Karl Krukov is working on Jeene, a Javascript library for partial evaluation, based on Douglas Crockford’s Pratt JS parser. Karl has just published some benchmarks (across all common browsers), where Jeene brings performance optimization of approximately 50%.

Tuesday, September 02, 2008

Thursday, August 07, 2008

Online publishing with

Issuu has an interesting solution for online publishing of print magazines and other publications. It is partially in flash, I usually don't like Flash, but their Flash stuff is really well done. And they take interesting approaches for the surrounding stuff of a web app as well, take a look at their documentation:, it's all google groups pages !

Tuesday, July 22, 2008

Perl on Google App Engine

Brad Fitzpatrick, the guy who added memchached to the Google App Engine, is starting a new project at Google: adding Perl support to the App Engine.

Monday, July 21, 2008

10gen: Cloud hosting platform offering serverside Javascript

There was some speculation that Google will offer it once they open up the App Engine Platform to more languages, there were some small-scale attempts with serverside Javascript (including the mine, with, which is currently receiving very little attention from my side) but now 10gen (with well known Java hacker and director of the Apache Software Foundation Geir Magnusson as CoFounder) plans to offer cloud-based hosting solution with any language running on the Java VM (at least that is what I am reading between the lines of their press release) and the funny thing is they don't start with Java itself, no they offer as first Language Javascript. The guys at 10gen also seem to like django, a quick look at one of the tutorials reveals they are providing a thing called djang10, django inspired framework for creating web applications purely in Javascript.

Saturday, June 28, 2008

Erlang Exchange 2008

The last two days I have spent at the Erlang Exchange Conference. It was great to met other Erlang hackers in person I just knew from their blog, emails or mailing list. Below the slides from my talk:

Saturday, June 14, 2008

Javascript syntax highligting for Firebug

The syntax highligting capabilities of CodeMirror, my favorite Javascript based code editor (for Web IDE-type applications) found their way into Firebug, currently available as additional extension.

Friday, June 06, 2008

Google App Engine limitations and workarounds

One of the current limitations of the Google App Engine is the lack of scheduled background processes. But early adapters are creative to circumnavigate this and other limitations. The most simple solution to this problem has William Vambenepe: he uses Google Reader to subscribe to a dummy RSS feed on his App Engine hosted test app, that results in some kind of regular polling with an interval of about 30 minutes. Of course this can't be used for any serious stuff, and the eight seconds maximum lifespan of a request also is not helping much to improve the situation. William concludes:
In the meantime, this was a fun exploration of the GAE environment. It makes it clear to me that this environment is still a toy. But a very interesting and promising one.
A more sophisticated but also much more complicated solution to the same problem has Peter Dolan: HTTPMR, a Map Reduce implementation in Python for running on HTTP based web clusters such as Google App Engine.

I am experimenting myself with a completely rewritten, not yet released version of ErlyComet, for adding a RESTful, highly scalable Comet layer with transactional cache in front of Google App Engine (or any other service which provides easy, cheap, reliable and scalable solution for persistence and shortlived HTTP requests)

Sunday, June 01, 2008

Malicious Flash fullscreen mode

Go there an try it yourself. It doesn't do any real harm, but it can scare people, especially those not really familiar with the latest capabilities of the flash player, such as full screen mode. While this example is just fun and actually the first example of this kind I have seen, I guess the same principles could also be used for real malicious stuff (e.g.: a new kind of phishing).

Thursday, May 29, 2008

IETester - makes web page testing on IE less painful

Previously I was switching between several virtually installed Windows XP instances on Parallels (for Mac OS X), just for testing a web page on different versions of Internet Explorer. Now I have installed IETester, a free Windows tool, which allows to run simultaneously (and switch between) the following IE versions:
  • IE 5.5
  • IE 6
  • IE 7
  • IE 8 beta 1

Monday, May 26, 2008

Notapad - the start of a dojo based WebIDE

Niccola Rizzo has been working for a couple of months now on the CodeTextArea dojo widget for in-browser Javascript code editing and he has just launched a public demo and test site named notaPad.

The editor provides Javascript syntax highlighting and additional functionalities with the following key bindings:

CTRL + space - autocomplete
CTRL + x - CUT
right click on the row numbers - BOOKMARKS

Sunday, May 25, 2008 not updating homepages

Shame on you, Google ! The last few posts of this blog did only update my blog homepage after about 24 hours. I guess updating the homepage is not part of the transaction when a new post gets stored somewhere on BigTable. So if you wanna see the actual homepage of this blog instead of an out-of-date cached version, type in: (instead of

Anyway, real men build their own blog engine, instead of complaining. Right now new blog engines are popping up like mushrooms, as result of some 60000 developers messing around with Google App Engine. Unfortunately those real men are facing real problems when trying to completely import old blogs into their custom blog engine, at least that is what happened to me when I tried some years ago with a custom Rails blog engine. So for now let's hope the issues are just temporary ...

Update: It's getting worse. Right after posting, also continued to serve the outdated cached version.

Update II: A couple of hours later, at least the .../index.html home page got updated.

Saturday, May 24, 2008

js2-mode - the second most important Javascript tool

I have been using js2-mode (an Emacs Javascript mode) for a couple of weeks now. I started using it out of curiosity, at the time I gave up on TextMate as all-purpose editor and turned back to Emacs, mainly because Emacs has so much better Erlang support. Now I consider js2-mode as the second most important Javascript tool (nothing can beat Firebug of course, and Firebug 1.2B1 on Firefox 3RC1 really rocks !). It fits perfectly into my work flow, you don't have to learn anything specifically to use it, it shows on-the-fly any syntax errors, global variables (which usually are unintentional), does a great job of line indenting, but because line indenting is often a question of personal style, js2-mode offers several possibilities you can cycle through via TAB. And in case you don't like how js2-mode works out-of-the-box, there are tons of customization options.

The only thing I am missing: I would like to use js2-mode as well as minor mode in HTML, but that doesn't seem to work yet.

Update: After writing this post, I just discovered another recent article about js2-mode with focus on syntax highlighting.

Friday, May 23, 2008

Dojo Widget for in-browser editor CodeMirror

CodeMirror, a very impressive in-browser code editor for Javascript, XML/HTML or CSS (or any language, you just have to plug in a your own parser) made some nice progress in the last months. CodeMirror has no dependency on other frameworks or libraries. If you want to use it in a dojo environment as a dojo compatible widget, here I am gonna share here a little tutorial how to write such a thing:

First download CodeMirror and transform CodeMirror.js (the main file which loads the other files into an iframe), into something like this:


dojo.declare("mystuff.widget.CodeMirror", dijit._Widget, {

initialized: false,

// currently supported: 'xml' (HTML), 'js' or 'css'
type: 'xml',

options: {
stylesheet: "",
path: "/static/codemirror/js/",
parserfiles: [],
basefiles: ["codemirror_iframe.js"],
linesPerPass: 15,
passDelay: 200,
continuousScanning: false,
saveFunction: function() {
content: " ",
undoDepth: 20,
undoDelay: 800,
disableSpellcheck: true,
textWrapping: true,
readOnly: false,
width: "100%",
height: "100%",
parserConfig: null

postMixInProperties: function() {
this.options.stylesheet = "/static/codemirror/css/" + this.type + "colors.css";
this.options.parserfiles = ["parse" + this.type + ".js"];

postCreate: function() {

startup: function() {
if (dijit._isElementShown(this.domNode.parentNode))

initialize: function() {
if (this.initialized)

frame = document.createElement("IFRAME"); = "0"; = this.options.width; = this.options.height;
// display: block occasionally suppresses some Firefox bugs, so we
// always add it, redundant as it sounds. = "block";


// Link back to this object, so that the editor can fetch options
// and add a reference to itself.
frame.CodeMirror = this; = frame.contentWindow;

var _this = this;
var html = ["<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"" + this.options.stylesheet + "\"/>"];
dojo.forEach(this.options.basefiles.concat(this.options.parserfiles), function(file) {
html.push("<script type=\"text/javascript\" src=\"" + _this.options.path + file + "\"></script>");
html.push("</head><body style=\"border-width: 0;\" class=\"editbox\" spellcheck=\"" +
(this.options.disableSpellcheck ? "false" : "true") + "\"></body></html>");

var doc =;;

this.initialized = true;

getCode: function() {
return this.editor.getCode();

setCode: function(code) {

focus: function() {;

jumpToChar: function(start, end) {
this.editor.jumpToChar(start, end);

jumpToLine: function(line) {

currentLine: function() {
return this.editor.currentLine();

selection: function() {
return this.editor.selectedText();

reindent: function() {

replaceSelection: function(text, focus) {
if (focus) this.focus();

replaceChars: function(text, start, end) {
this.editor.replaceChars(text, start, end);

getSearchCursor: function(string, fromCursor) {
return this.editor.getSearchCursor(string, fromCursor);
Then your should concatenate and minifiy (I use YUI compressor) all the JS files:

util.js, stringstream.js, select.js, undo.js, editor.js
=> codemirror_iframe.js

Also minify the parsers: parsejavascript.js, tokenizejavascript.js, parsecss.js, parsexml.js

At this point you can embed the widget into a test page:
Now comes the tricky part: the editor does not initialize automatically at page load, because with dojo, chances are very high, you are gonna use this widget inside a container, where the editor is hidden at page load, and that would cause trouble with some browsers. So you need to subscribe to an event which triggers the visibility of the editor, so it can be lazy-initialized at first time it becomes visible. For example to use CodeMirror inside a tab container with a tab with id 'html_editor_tab' I do something like this:
dojo.declare("MyApp", null, {
main_tab_selected: function(page) {
if ( == 'html_editor_tab'){

var myAppInstance = new MyApp();

dojo.subscribe("main_tabs-selectChild", myAppInstance, "main_tab_selected");
Update: Uhh, where was my brain when I wrote this article, I accidentally "misspelled" CodeMirror with CodePress at several places, including the title, it's corrected now ...

New Erlang web framework by Torbjorn Tornkvist

Tobbe just announced the very first release of a new, very simple Erlang based web framework fully integrated into erlware. It has support for sgte templates. Tobbe also has a collection of other highly interesting web related projects in his git repositry, including domerl, a simple, yaws and JQuery based Comet lib.

Hard to find technical docs about dojo internals

Of course an open source framework has no real untold secrets, but digging into the source code can be time consuming and and without in-deep documentation it's difficult to extract the authors thoughts behind it, so I was pleasantly surprised when I stumbled upon this links about dojo internals (which currently can't be found, or at least not by me, at dojo documentation):

Wednesday, May 14, 2008

Next flashplayer ships with speex audio codec

See the release notes. Speex is one of the best codecs for VoIP, and it is patent-free and open source. Related to this is also a new UDP-based network protocol called RTMFP for faster realtime media and P2P-capable, which will be part of flashplayer 10, now let's hope Adobe will release this protocol as part of their open specification initiative, but I guess they will try to keep RTMFP proprietary (at least until it gets reverse engineered), so they can sell their overpriced Media streaming servers.

Google JS library released

As part of Google's effort to better document the open web, they released today some of their Javascript libraries. I browsed a bit through the code, it is well documented and one thing grabbed my attention: the code structure looks similar to dojo, e.g. below a snippet from their DOM lib with ''provide" and "require" statements:



I never really understood why people were using XHTML and I usually tried to clarify by pointing to articles by respected Web experts (e.g.: Ian Hickson, Brad Neuberg).
Today I read this and collected some more links about use and misuse of XHTML:

Thursday, May 01, 2008

Adobe "opening" a few more bits of Flash

Their new initiative is called Open Screen Project and is dedicated to drive consistent rich Internet experiences across devices. It is not about open sourcing the flash player, just about opening some specifications, such as FlashCast protocol and the AMF protocol. But AMF for example has been reverse engineered long time ago, in 2003 when I contributed to JavaAMF, this protocol has already been implemented in numerous other languages.

What I would like to see is RTMP (the Flash Video transport protocol) as open specification, so let's hope they consider this at their next round of "opening".

Wednesday, April 30, 2008

Firefox extensions for JS disabling and Python integration

My collection of Firefox extensions is mostly just the usual stuff you need for web development, such as Firebug, MeasureIt, ColorZilla, S3Fox, FlashSwitcher and a few more. After Firebug, for long time I didn't spot anything comparable spectacular. But recently I discovered some interesting extensions:
  • QuickJava: Finally an extension which makes it dead simple to disable/re-enable Javascript (I use that often to see how Ajax enriched webpages look like without Javascript). Just one click on a status bar button to enable/disable and reloading the page. Here there is even room for improvement: I would like to have enabling/disabling optionally coupled with reloading. Anyway, other extensions which provide the same functionality require a lot more GUI interaction.
  • Pyxpcomext: Python bindings (PyXPCOM). This extension doesn't provide any direct end user functionality, but makes it possible to write extensions in Python instead of Javascript. Just for fun I installed the Python Shell. I can think of many potential use cases, e.g. integration with the Python based App Engine SDK, so that web designers not comfortable with command line interfaces could easily interact with the local App Engine test webserver via such an extension, when testing their templates and stylesheets.

Friday, April 25, 2008

The missing feature of the Web: a DNS REST API

I have been waiting for years, that a quality DNS provider will a offer a REST API for setting DNS Records, but there is still no such a thing on the market. There is a SOAP based offering from Nettica (unfortunately I have an SOAP allergy). And there are the REST APIs some service providers are exposing for updating dynamic IPs.
DNS Made Easy, one of my preferred DNS providers, told me about a year ago they were working on such an API. I am still waiting. Anyway, if anybody is aware of such a service, please let me know.

Update: Found a possible solution (but I haven't actually tested their service yet): Slicehost, a similar service as Amazon EC2, they seem to have an API which allows to manipulate DNS records. But your domain has to be hosted on slicehost.

Update II: WorldwideDNS is another option.

Thursday, April 24, 2008

It's getting cloudy - Yahoo Application Platform

Just read this on TechCrunch:
... Yahoo Application Platform (YAP) - which will be a direct competitor to Google App Engine. Users can host their independent applications on Yahoo’s bandwidth, storage, database and CPU resources. At first they’ll support SecurePHP applications only, but they’ll expand to additional languages over time. The model will be very similar to Google’s - free usage up to a point, metered after that. They’ll also offer various developer tools as well.
With Yahoo offering cloud based PHP app hosting, I hope Google will focus on soon adding the already announced really useful features to App Engine, and not waste engineering efforts for supporting PHP.

Tuesday, April 22, 2008

Cryptography API for Google Gears

Gears will provide native cryptography to web applications, at least this is what Google Summer of Code student Mike Ter Louw is planning to implement in the coming months. While it is possible to implement browser side cryptography in Javascript (e.g.: dojox.encoding), only few Ajax applications use this functionality, because it is slow and for communication purposes it only adds a very thin layer of security (requiring lots of tricks) , compared to HTTPS.
But HTTPS is a bit of a problem in todays clouding computing platforms, because it requires static IPs tied to a domain name for a valid certificate. So gears maybe will become a preferred option to increase poor man's web application security.

Saturday, April 19, 2008

Flash done right and on Google App Engine

Often I criticize the usage of Flash for content centric pages, because often Flash is implemented in a way it causes a disastrous user experience (from arbitrarily resizing browser to sound which you can't turn off and fonts which you can't resize, just to mention the worst mistakes). Now I came across a new project, which advocates to do Flash the right way: gaeswf by Aral Balkan, a client and server side open source framework, based on a collection of best practices for using Flash on Google App Engine, in a way that Flash does NOT suck. The proof-of concept (live demo) implements techniques such as:
  • Embedding Flash with SwfObject
  • Deep linking (based on SwfAddress)
  • Flash content that obeys browser text-size changes

Tuesday, April 15, 2008

Google App Engine Team fixing issues quickly

Toying around a bit today on Google App Engine, I found a minor issue (not security related, very easy to work around and only affecting Mac users) in an add-on for the actual SDK. Only 32 minutes after I reported the issue they had fixed it !

Sunday, April 13, 2008

Amazon announced persistent storage for EC2

If Google App Engine does not provide enough flexibility for you, then there is some good news from Amazon: one of the missing pieces, persistent storage for EC2, has just been announced.

Exploring some lesser known Ajax GUI toolkits

I have only been exposed so far to Dojo and ExtJS, and I believe both are bleeding edge technology, provide a great user experience and are widely accepted. But there are about 50 more Ajax GUI toolkits out there. And some of them occasionally appear on my Google Ads, so out of curiosity I took a quick look at some randomly chosen ones:
  • SmartClient Ajax GUI System: Lots of widgets, but they are all table based and look desktop-like, that makes it a very Web 1.0 experience.
  • Icefaces: An Ajax GUI toolkit for integration into J2EE systems. Also lots of widgtes, looks a bit less desktop-like, but here as well I see tables (e.g. their tab container) where I think pure DIVs and a bit more CSS provide a better user experience (smother loading). I am not a J2EE guy (anymore), so I did not look closer at this product.
  • Nitobi: Their website looks nice and well organized, so I head high expectations. But I switch randomly between browsers and at the time I tried the Nitobi demos, I was using Safari 3,1. Unfortunately I could not load the demo (then I tried on Firefox and there everything worked fine and looked good). But then came the ugly part: They provide a free trial version with a 30 day evaluation period and beyond that you are expected to buy a license, prices start at $ 429 US and go up to $ 3699 for the enterprise version !!!
  • Telerik RadControls for ASP.NET: Even more expensive: prices start at $ 799 US. And you have to register on their site just to download the trial version. At least I could load the online demo, even on Safari. And it looks good, very good, nearly as good as ExtJS.
Lesson learned: there is a reason these Ajax GUI toolkits are lesser known !

Scaling down - the least talked about feature of GAE

It launched less than a week ago and now all over the blogosphere people are discussing the Google App Engine (GAE). Most talk is about scaling up, about potential lock-ins, even if the SDK is based on open source software. Only one thing where developers seem generally to agree: with Python, Google has made a good choice (maybe those not knowing Python yet but desperately looking forward to learn it, don't know that Python dictates line indention, actually the only thing I had difficulty to get used to). That is interesting by itself, because developers usually are highly opinionated in regard to programming languages. Or is it just the early adapter mentality which is more flexible ? Anyway - in this article I want to talk about something I haven't found mentioned yet at 100 other places:

scaling down

I see a growing number of businesses reducing or eliminating their IT department by using Google Apps (gmail & Co. on custom domain) for e-mail and other standard tasks covered by the Google Apps suite. Custom built applications for streamlining their non-standard, probably also simple but business specific work-flow has been beyond the budget of small organizations. So they used the available standard tools, which are often more complex than necessary for those tasks. But now the creation and especially the maintenance of custom built web applications is getting cheaper with GAE, because problems like authentication, deployment, high availability and even data redundancy (as probably-good-enough backup-strategy) are solved already and the cost for hosting gets completely eliminated (scaling down means just few concurrent users per application, little resource usage and the app will probably stay within the quotas for free usage of GAE). So the saved money from traditional in-house or outsourced IT administration, spent on development of custom applications will allow organization to improve their efficiency. And Google of course still will make good money with this scenario, because some companies will choose Google Apps Premier Edition over free/limited edition and will pay Google 50 $ per user account / per year.

Thursday, April 10, 2008

Google App Engine - Niall Kennedy's summary

Great summary about the Google App engine, by Niall Kennedy. He even provides some insights about the people behind it, and according to his first hand knowledge, this is just the beginning of what Google is rolling out:
I met with the App Engine's team leads on Monday morning for an in-depth overview of the product, its features, and its limitations. Google has been working on the Google App Engine since at least March 2006 and has only just begun revealing some of its features.

Wednesday, April 09, 2008

Erlang R12B-2 released - with native PNG drawing

It's a bugfix release and I had no big expectations when scanning through the release notes, but then I spotted this:
--- percept-0.7 ------------------------------------------------------------

OTP-7162 Percept no longer depends on external c-libraries. The
graphical rendering is now done via erlang code.
Thats huge, if you are interested in generating PNG images and don't wanna have dependencies on c-libraries (as you would have using my cairo wrapper erlycairo). Egd won't win any speed competition and has a limited feature set, but runs out of the box on any Erlang supported platform !

Tuesday, April 08, 2008

Google App Engine - Quotes and thougts

From the many blog posts about the Google App Engine, my favorite quote comes from Dave Winer:
Now, what Google announced is really exciting! I'm not kidding. It's even better than I hoped. Yes, it's only Python, but IBM's PC-DOS was only BASIC and Pascal when it first came out, and it didn't matter. Yeah, I preferred C, but I coded in Pascal because that's what you had to do to get an app running. What you're going to see here that you've never seen before is shrinkwrap net apps that scale that can be deployed by civillians. That's a mouthful, but that's what's coming. Why? Because here is a standardized platform that can be stamped out in the billions of units. Maybe Google can't do it, but the perception is that they can. Who is willing to stand up and say Google hasn't nailed scaling? What PCs did in the 80s, Google is doing now. PCs took the black magic out of owning a computer. Now Google is taking the black magic out of operating a scalable web app. Python is the new BASIC.
There were also lots of negative thoughts, e.g. Donna Bogatin:

Google’s latest attempt at Internet shock and awe replays the by now traditional Google routine of “giving away” Web services under the guise of disinterested benevolence while the Web cheers the supposed Googley revolutionary Internet disruption and forecasts doom for existing players, such as Amazon, for this example.
In typical Google fashion, though, “free” comes at a very high price. In fact, the Google App Engine product unveiled by the high-flying corporation is in contention for the scariest Google move to date.
Not only do startups using Google App Engine unwittingly put control of their businesses in the sole discretionary hands of Eric Schmidt and company, unwitting consumer users of Google App Engine hosted services automatically “share” all of their personal, proprietary data with Google, whether they really want to or not.
Generally people are comparing the App Engine with Amazon's AWS offerings and either seem to be interested in the one or the other. I think these two services can be combined for easy creating scalable web applications which go beyond what you can do with a limited amount of time and money, compared to the scenario where you would use just one of the services. Let me elaborate: For the simple, stateless stuff, for static and dynamic HTML pages and for persisting data, Google App Engine is perfect. For advanced stuff like Comet HTTP push, video streaming or batch processing, Amazon EC2 instances could be used on demand just for that.

Trying out Google App Engine

Yesterday night Google launched App Engine, a highly scalable web application platform, which has the potential to become a game changer. I was lucky to grab a developer account, which is currently tied to several limitations:
  • only 10000 developer accounts available
  • applications have to be coded in Python
  • only three applications per developer
  • bandwidth, storage and CPU usage limitations
  • no road map, no info about future pricing model
On the other hand, it's free for now, you can use the Django open source web framework and template language, you can locally develop and test your app with the cross platform Google App Engine SDK (download size only 2.3 MB - on Mac OS X), you get a powerful administration interface at your Google account and most important, it is extremely easy to get started with, in no time you have a schema-less, database driven helloworld web application deployed on Google's server farm.

The internet users may start their own home business by having business deals with the global entrepreneurs. The different brands of computers have been manufacturing the latest and stylish models of different sizes and shapes for the computing clients. The main features of hosting plans of godaddy are reputable among the potential customers. You may get hosting services of high quality in affordable rates by joining powweb, reliable web host.

Sunday, April 06, 2008

Skype and PostgreSQL database

PostgreSQL is my favorite open source relational database. Some time ago I wrote some experimental code (currently unmaintained) for integrating it with erlyweb. The guys at Skype seem to like PostgreSQL as well. In regard to the current Google Skype takeover rumors (or was it just a 1st of April joke which went out of control ?) and to this article: Skype Plans for PostgreSQL to Scale to 1 Billion Users, I took a look at the Skype open source projects and found a few interesting ones related to PostgreSQL:
  • PL/Proxy: Horizontal data partitioning, based on a hashed database field (for distributing large amount of data among several physical servers).
  • SkyTools: DB cluster management software for replication, message queues, fail over and Python integration.
  • PgBouncer: connection pooling.

The most advanced features of backup software are very assistive for exclusive disaster recovery of data. The web site design services are also the main part of some hosting plans of the service providers. The benefits of affiliate marketing have been attracting a number of investors and entrepreneurs of this global business community rapidly. The webmaster is responsible for administering all web applications expertly.

Wednesday, April 02, 2008

Easy git on Emacs with emacs-git

I have been using emacs-git for the last few days and and it proved incredible useful. It let's you do interactively most of the basic git operations such as creating, cloning or importing a repository, it inidcates graphically the git status of the current file with a colored LED-like icon at the Emacs bottom status line and it also facilitates adding / removing files to the repo, ignoring files, tagging, merging and conflict resolution.
Emacs-git works only on Emacs (and not on X Emacs) and requires a very recent version of Emacs (I am using it on a nightly build of aquamacs, which is based on Emacs from CVS).

Monday, March 31, 2008

Emacs on Ajax with Steve Yegge's new js2-mode

Steve Yegge just released a new Javascript Emacs mode. I installed it and played around a bit and syntax highlighting and indention seemed to work perfectly. The feature list is impressive (copy-pasted from project page):
The best news comes now: according to his blog, this is just the beginning:
This is part of a larger project, in progress, to permit writing Emacs extensions in JavaScript instead of Emacs-Lisp. Lest ye judge: hey, some people swing that way. The larger project is well underway, but probably won't be out until late summer or early fall.

My new editing mode is called js2-mode, because eventually I plan to support JavaScript 2, also known as ECMAScript Edition 4. Currently, however, it only supports up through JavaScript 1.7, so the name is something of a misnomer for now.
Plenty of reason to switch back to Emacs for those like me who thought that TextMate was the future.

The Power of Javascript - by Glenn Vanderburg

Wanna listen to an in-depth introduction to Javascript, not just the technical but also the historical side ? Then this talk by Glenn Vanderburg recorded at JAOO 2007 is the right choice (direct link to the media - flash .flv video).

The talk mentions Douglas Crockford's famous article: The World's Most Misunderstood Programming Language from 2001. Just for completeness, here is Crockford's recent follow-up article: The World's Most Misunderstood Programming Language Has Become the World's Most Popular Programming Language.

Saturday, March 29, 2008

What sucks most about the Mac

.. are those nearly weekly software updates which require a reboot. I didn't buy a Mac because I was influenced by those all-day-long digging mac fanboys, I bought it because I wanted to run some graphics and video editing software which is not available for Ubuntu Linux (my previous desktop system, from windows I stay away as far as possible) and for paying about twice the price compared to a similar Dell or noname hardware configuration capable of running Linux, I really expected a better user experience in every possible aspect, as promised in their glorified advertisement. But the requirement to reboot the machine for those nearly weekly minor updates really puts the Mac back into the stone age of computing !

Friday, March 28, 2008

Doloto - Javascript Rewriting paper by Microsoft

I just read the reseach paper (pdf) about Doloto a Microsoft project for speeding up Web 2.0 applications by serverside Javascript static code analysis, AST transformations and code splitting. They claim that with this technique the loading time of monolithic (all Javascript loaded at once) Ajax applications can be significantly reduced. In my opinion, a better approach is to build right away non-monolithic apps (Javascript libraries like dojo provide support for that).

Wednesday, March 26, 2008

Crary - A new Erlang lightweight web server

Beside of featherlight iserve and battle proved mochiweb (at MochiMedia), there is now an additional choice for lightweight Erlang HTTP servers: Crary, which shares similar design goals but provides a different interface. According to its author Scott Parish:
Crary, a HTTP server for the REST of us.

The intention is that its small enough and flexible enough to be used for most any HTTP server need. While it isn't a stand-alone system, nor does it have its own web-framework, these things can easily be built on top of crary. Crary should be easily embedded into the release of a larger application to provide a web interface or to create a web service interface.
Below a tiny little snippet illustrating how to write a hello world program with crary:
start() ->
crary:start(8080, {?MODULE, handler, []}).

handler(#crary_req{method = "GET", uri = #uri{path = "/favicon.ico"}} = Req) ->
crary_dir_listing:write_file(Req, filename:join([my_doc_root(), "favicon.ico"]));
handler(#crary_req{method = "GET", uri = #uri{path = "/test"}} = Req) ->
crary:r(Req, ok, [{"content-type", "text/html"}], <<"hello world">);
handler(#crary_req{method = "GET"} = Req) ->
handler(Req) ->
To get your copy of crary just clone it from its git repository, or install it via erlware.

Tuesday, March 25, 2008

New YouTube player - Nice, but still not ready for HD screencasts

Geoff Stern, the Google guy who recently rewrote the YouTube player, just posted an interesting demo, mashing up the video player with the Google maps API, demonstrating the new player's Javascript integration capabilities.

Other examples out there:
This brings new possibilities for screencasts (or video presentations / podcasts), for syncing the audio/video with text caption or any HTML content along the audio/video timeline. Now I am just waiting for YouTube not destroying anymore the HD quality of uploaded quicktime videos when they convert it to flash (requiring cumbersome hacks like this for online HD flash video), so that YouTube can eventually be used for high quality screencasts and video enabled online presentations.

Update: more chromeless players:

Sunday, March 23, 2008

Erlang processes benchmarked against threads of other languages

We all know that the result of benchmarks are only significant for that specific piece of code which is getting tested, and usually the benchmark authors favorite products are tuned to outperform its competitors. Nevertheless, below a summary of a benchmark recently discussed on reddit. The benchmark itself is just a few lines of source code (at least in Erlang), spawning a bunch of processes and doing some simple message passing between those processes. Thread implementations in other languages:
  • C (pthread - GNU gcc): 8.5 times slower
  • Python: 15 x slower, 1.4 x more memory
  • Java: 20 x slower, 5.8 x more memory
  • Ruby: 282 x slower, 3.4 x more memory
More numbers, details and the benchmark source code in all the different languages at the language shootout site.

Monday, March 17, 2008

The gBrowser is coming - disguised as Google Gears

At least this is the impression I get when I take a look at the Google Gears developer documentation , especially the wiki pages with label DesignDoc and the discussions in the contributor mailing list. Here a few examples to illustrate what I am talking about and what will hopefully soon come to any browser near you:
  • AudioAPI: Playback, Recording, Mixing and Editing of WAV, OGG and MP3 audio.
  • LocationAPI: Provides geolocation.
  • ImageManipulationAPI: mentioned in the BlobApi description.
  • OpenGL vector drawing: discussed in this thread.
Upgrading existing browsers with Javascript APIs providing HTML5-compliant functionality is much better for a healthy, accessible, easy indexable and open standards oriented near future of the web, than relying on proprietary plugins such as the flashplayer for specific functions which can' t be provided by HTML/CSS/Javascript of todays browsers.

Wednesday, March 12, 2008

Podcast: Joe Armstrong on Erlang

I am currently listening to this Podcast by Joe Armstrong, creator of Erlang. It's a great overview and has lots of historic and other background information.
In case you are new to Erlang, and need something more entertaining and haven't seen yet the classic, "Monty Python" Erlang video, you must see it !

Saturday, March 08, 2008

ErlyDTL now has date and time formating

ErlyDTL, the Erlang version of the Django Template Language is progressing nicely. Most of the common tags and filters are implemented. Recently Colm Dougan joined the development team and added date and time formating.

Let's take a look at some examples with fictive dates:

Template: {% var1|date "r" %}
Rendered Output: Thu, 21 Dec 2000 16:01:07 +0200

Template: {% var2|date "jS F Y H:i" %}
Rendered Output: 27th February 2008 01:24

Template: It is the {% var3|date "jS o\f F Y" %}
Rendered Output: It is the 4th of September 2007

Friday, March 07, 2008

Diving into Core Erlang

Inspired by Robert Virding's LFE - Lisp flavored Erlang, I recently started to evaluate Core Erlang as base for ErlyJS, the Erlang Javascript compiler I am working on. The current approach is based on Erlang Abstract Syntax trees. Erlang Core is more low level and looks more like a LISP dialect than Erlang. Following a short summary about Core Erlang's design goals (copy pasted from the spec):
  • Core Erlang should be as regular as possible, to facilitate the development of code-walking tools.
  • Core Erlang should have a clear and simple semantics.
  • Core Erlang should be straight-forward to translate to every intermediate code used in any Erlang implementation; similarly, it should be straightforward to translate from Erlang programs to equivalent Core Erlang programs.
  • There should exist a well defined textual representation of Core Erlang, with a simple and preferably unambiguous grammar, making it easy to construct tools for printing and reading programs. This representation should be possible to use for communication between tools using different internal representations of Core Erlang.
  • The textual representation should be easy for humans to read and edit, in case the developer wants to check what the Erlang source looks like in Core Erlang form, inspect – or modify – the results of code transformations, or maybe write some Core Erlang code by hand.
You wanna see how Core Erlang looks like ? Take any Erlang source code and compile it as binary and with the to_core compiling option and with core_pp:format/1 you can pretty-print the output. Core Erlang is an intermediate step between Erlang AST representation and VM internal representation. So far I see the following advantages by using Core Erlang for ErlyJS:
  • It is less tied to Erlang the language and therefore just a more natural choice.
  • There exist `let` expressions which seem to provide a cleaner way to handle Javascript variable reassignments (you can't directly reassign variables in Erlang).
  • And last and least, Ecmascript 4 Reference implementation is written in Standard ML, which is more similar to Core Erlang than to normal Erlang. Maybe this point will have relevance one day in the future.
Unless I will discover a show stopper, there will be soon a complete rewrite of ErlyJS to Erlang Core (but I am using git now and only pushing to googlecode SVN major changes in bulk).

Thursday, March 06, 2008

Erlang and Fuse

The Dukes of Erl guys have created an Erlang implementation of FUSE called fuserl. From reading their blog, it seems they need it for interacting with RRDtool, a open source software for realtime data logging and the ultimate goal for fuserl is a distributed filesystem based on mnesia: walkenfs (the idea is not new, Ulf Wiger has something similar as part of erlhive). Now I just read about another possible use case for fuserl:

The advanced strategies of internet marketing are employed by the different internet marketers to promote E-businesses. The web site design and web development programs are organized by the different IT companies. The cheapest domain name registration services are very useful for the medium kind of entrepreneurs who can’t afford expensive rates. The cheap hosting services of various web hosts are available to facilitate the individuals who run small businesses.

Saturday, March 01, 2008

When to use Ruby and when not

Just read this interesting article by Zed Shaw about Ruby, Ruby in the enterprise, Ruby on virtual machines and more ...

Saturday, February 23, 2008

ErlyJS - translating Javascript to Erlang

I have lately invested many hours of coding in ErlyJS, my open source attempt of writing a Javascript compiler for the Erlang virtual machine and crossed today the barrier of 100, for the number of commits and also for the number of test cases. There is still a long way to go, because nobody (including myself) will actually use the compiler in a real project, unless it is 100% Javascript compliant. But at least, most of the basic stuff is now halfway implemented:
  • Literals
  • Global / local variable handling
  • Operators (except of dot operator, for objects)
  • Functions
  • Built-in global functions
The next big task will be object handling (and implementing the built-in objects and their functions)

I am not targeting the Erlang VM directly (beside of the Erlang compiler source code, there doesen't exist any formal specification or at least documentation about the Erlang VM internals in general and specifically the VM opcodes). What I do is transforming the Javascript source code AST to an Erlang AST. This involves a lot of trickery, because Erlang doesn't allow variable re-assignments (this is good and also necessary in the context of Erlang concurrency), but most Javascript code is just a bunch of variable re-assignments, so I have to model it somehow and I have choosen to model it differently for global Javascript variables (Erlang process dictionary) and local variables (normal Erlang variables). One interesting thing about having an Erlang AST of Javascript source code is the possibility of pretty-printing Erlang source code. Let's take a look at a Javascript example from the test cases:
function test() {
var a=0, b="Bananas";

switch (b) {
case "Oranges":
a = 1;
case "Apples":
a = 2;
case "Papayas":
case "Bananas":
a = 2.5;
a = 3;
a = 4;

return a;

If I pretty print the AST (just before compiling it, and this is even done automatically at verbose ErlyJS compiling settings) I get the following Erlang source code:
js_test() ->
V78 = 0,
V80 = "Bananas",
{V152} = case V80 of
"Oranges" -> V170 = 1, {V170};
"Apples" -> V88 = 2, {V88};
X when X == "Papayas"; X == "Bananas" ->
V270 = 2.5, V288 = 3, {V288};
_ -> V32 = 4, {V32}
This kind of source code translation is extremely useful while developing and debugging the ErlyJS compiler and analyzing test cases.

Friday, February 22, 2008

Dojo theming tutorial and more at dojocampus

Ever wanted to know how to create flexible-size background images for rounded corners or other CSS effects specifically for custom-theming Dojo widgets ? Unless you have already intimate knowledge of the Sliding Doors technique and CSS sprites, you should checkout the "Rounded tabs" tutorial on the recently started DojoCampus site. There is also other great stuff there such as a video about the dojo grid and Firebug tips.

Tuesday, February 19, 2008

Discontinuing ErlyMate

My attempt of better integrating Erlang with TextMate has been an interesting trip into foreign territory (Objective C and Desktop applications), but I never considered it as a serious project, it was more a kind of overreaction to my inability of mastering all Emacs key bindings even at sleep. And I also don't like to put lots of time into an open source project to erlangify a proprietary, Mac-only software from a one-man-company. Anyway, if this are non-issues for anybody who wants to resurrect the project, I will be available to answer initial questions. Ok, this was probably my last post about ErlyMate here.

Erlang – The CEO’s View - by Gordon Guthrie

An interesting article about Erlang from the business point of view, by Gordon Guthrie the CEO/CTO of

Saturday, February 16, 2008

Interfacing Erlang with C - explained by Joel Reymont

Great tutorial on how speeding up Erlang with linkedin C code. But hopefully you won't have to do it because it makes your software hard to maintain and the C part might crash your program. But if you have to interface with C, then first check whether a C-node (as for example done in ErlyCairo) has enough performance, a C-node uses it's own memory space and doesn't crash your Erlang program, in case things go wrong. But if your C code is very robust, and you really need the performance, Joel's tutorial is a great introduction to that topic.

Thursday, February 14, 2008

Django Template Language - the dojo implementation

Beside of Erlang based ErlyDTL (by Evan Miller and myself) there exists (at least) one other non-Python project which implements the Django Template Language: the dojo Javascript version: dojox DTL (documentation) for creating dynamically and template-based HTML layouts inside the Web browser (opposed to traditional approaches of creating HTML layouts at server-side). Today dojox DTL reached feature completeness, implementing all original Django tags and filters, at least that is what I guess from reading the SVN changes for the README:
--- This aims to be a 1:1 match with the Django Template Language as outlined in
+++ This is a 1:1 match with the Django Template Language as outlined in
While dojox DTL is a very interesting concept and brings new possibilities to separate client-side logic and presentation, I haven't seen yet a killer example. Maybe I just haven't looked far enough. But one thing is sure: if you use a template language at server side and at Javascript client side, and it can be the same template language, that's a huge benefit.

Wednesday, February 06, 2008

Erlang Style Concurrency - explained by Ulf Wiger

That is probably all you ever wanted to know about Erlang style concurrency, put into a great summary by Ulf Wiger, who has been using Erlang since 1992.

Friday, February 01, 2008

New book "Mastering Dojo" - beta PDF now available

For those who prefer to learn new Javascript stuff by reading a real book, Mastering Dojo (500 pages) has been announced today. It will be relesed in June, but the beta PDF is already available. Alex Russell, one of the initial developers of dojo, is a co-author of that book.

Update: I ordered the PDF version, right after writing this post, but haven't received the e-mail with the download-link yet, so all what is really available right now, are the two example chapters at the publisher's site.

Tuesday, January 29, 2008

More on serverside Javascript - Rhino on Rails

Dion Almaer has recently interviewed Steve Yegge about his project of porting Rails to Javascript, you can listen to it right here:

Tuesday, January 22, 2008

Serverside Javascript with Jaxer

Today Aptana (mostly known for their eclipse based Ajax IDE) launched Jaxer, an open source based Ajax server for using Javascript as server side scripting language. It is built on top of the Apache Web server and and the Spidermonkey Javascript engine and has an API which covers most developers needs: File and database access, logging, email and all kind of other utility functions.

So what are Jaxers major selling points ?
  • Write entire applications or presentation layers in Ajax.
  • Share code between browser and server.
  • Database and file access from JavaScript.
  • Integration with Aptana Studio (their Ajax IDE).
The most important question for me of course is how it compares to erlyjs, my Javascript-to-Erlang compiler project with main purpose of running Javascript at the serverside for Ajax web applications. Obviously Jaxer is available today and now and erlyjs is work-in-progress far from being ready to use yet. Both share the same vision and both use Spidermonkey. But while on Jaxr the Javascripts really run within the Spidermonkey engine, erlyjs uses Spidermonkey only for parsing the Javascript, then compiles the parsed Javascript to Erlang beam files, for running on the Erlang virtual machine. I believe my approach gives significant performance and scalability advantages (and integrates better with the rest, in those rare cases where the rest is written in Erlang as well ...)

Thursday, January 17, 2008

Hypernumbers whitepapepr: comparing Erlang and LAMP web stacks

Using Erlang In A Web Start-Up is a whitepaper (PDF) by Gordon Guthrie, pointing to advantages from the business point of view when choosing Erlang.

Tuesday, January 15, 2008

ErlyDTL - the Django template language in Erlang

I have been working on a new template language called ErlyDTL. Let's compare it first with the other, established players in the Erlang open source template languages field:
  • ErlTL by Yariv Sadan. ErlTL is used in ErlyWeb and therefore probably the most popular Erlang template language. It exposes the full Erlang language to the template author, that is good, if the template author is an experienced Erlang developer, but bad, if the template author does not know Erlang. ErlTL compiles templates to beam files.
  • sgte by Filippo Pacini. An Erlang implementation of StringTemplate. Enforces separation between model and view. Templates get evaluated at runtime. Used at erlware (if you install the erlware launcher, sgte is one of the core packages used internally for the various erlware templates)
  • ErlyDTL by Evan Miller and myself: based on the Django template language. It does not expose Erlang to the template author, it compiles templates to beam files, pre-renders as much as possible at compilation time and supports a lot of features such as template inheritance, presetting variables at compilation time, automatic HTML escaping and lots of Django tags and filters. But it is not feature complete yet, just the more important tags and about half of the django filters are currently implemented.
If you wanna learn more about ErlyDTL, check out the code or take a look at the examples, there are a bunch of ErlyDTL demo and test templates at he googlecode project and also the resulting, rendered output files.

Update: There are more Erlang template engines out there: seethrough which is specifically for XML/XHTML and internally uses xmerl to do its magic. It is rather simple compared to the others, but depending on the use case that can be an advantage.

The search engine optimizers are very much expert to manage ppc productivity in an efficient manner. The main function of web hosting service provider is to help the individualistic web sites to have direct accessibility to worldwide immediately. The website design templates are designed by the professional web designers which can be downloaded from different web directories free of charges. The internet service providers offer their latest services of dsl which are reliable and affordable for internet users.

Sunday, January 13, 2008

CodeMirror - an AST aware in-browser code editor

I have been following for a while now the development of Javascript based code editors and web IDEs (see here and here), I even started to build one myself, because I thought there is no such AST aware editor out there, at least until I discovered codemirror, which comes with support for Javascript and HTML, and with support I mean it has a real parser (and a CSS file for syntax highlighting) for those languages. Marijn Haverbeke, the author of this masterpiece of functional Javascript programming has released today a new version, which makes it easy to integrate it with a different Javascript libraries (codemirror itself uses MochiKit).

Codemirror has the following features:
  • syntax highlighting
  • automatic code indentation of current line on pressing TAB or RETURN
  • if some code it selected, automatic indentation of current selection on pressing TAB
  • works with all common modern browsers
  • highly configurable: additional languages, performance settings, etc.

Sunday, January 06, 2008

Zed Shaw on Rails (Ghetto)

The new year started with an explosion in the Rails community: Zed Shaw's Rails rant, where he points to some well known Ruby/Rails-people, explains why they are "assholes" and brings up some "general thoughts" such as:
This is exactly what makes Rails a ghetto. A bunch of half-trained former PHP morons who never bother to sit down and really learn the computer science they were too good to study in college.
Zed is the author of Mongrel, that made him well known and highly respected within the Rails community. But now I see people from the whole software industry blogging about him and his famous rant. Zed got mentioned on techcrunch and today I saw even a post from Rickard Oeberg about Ted's rant. A few years ago, Rickard was blogging in a very similar style, highly informative but also entertaining about the nasty things around the JBoss community (Rickard was the most important initial developer of the JBoss application server).