Archive for September 2007

Writing ExtJS apps in Java or C#

I don’t mind programming in JavaScript, but there are definately some annoyances. I definately miss code completion, refactoring support, etc. You pretty much have to have a window open for the docs to make sure I you are using the API correctly. It can also be pretty frustrating when you fat finger a config object and your widget does not behave like you want it to. Visual Studio 2008 seemed promising with its Intellisense feature for JavaScript, but it does not appear to play nicely with libraries besides Microsoft AJAX (http://extjs.com/forum/showthread.php?p=61484). If you want comments with your code completation, it also has to follow the Microsoft style of XML documentation (ExtJS uses JSDoc format).


I was thinking about this when I read Joel’s latest post yesterday:

What’s going to happen? The winners are going to do what worked at Bell Labs in 1978: build a programming language, like C, that’s portable and efficient. It should compile down to “native” code (native code being JavaScript and DOMs) with different backends for different target platforms, where the compiler writers obsess about performance so you don’t have to. It’ll have all the same performance as native JavaScript with full access to the DOM in a consistent fashion, and it’ll compile down to IE native and Firefox native portably and automatically. And, yes, it’ll go into your CSS and muck around with it in some frightening but provably-correct way so you never have to think about CSS incompatibilities ever again. Ever. Oh joyous day that will be.

And then when I read Nikhil’s post today where he goes on to say that we already have a something like that — Script# and GWT. These tools are great, but the problem becomes converting existing libraries to Java or C# so that they can be used.


There are two promising ExtJS wrappers, one for Script# and one for GWT, extsharp and GWT-EXT. From what I can tell, it looks like GWT-Ext was ported from the ExtJS libraries. extsharp uses a different conversion strategy — it creates C# classes from the parsed JavaScript source and includes the original comments. Take a look at the pictures on the main page of extsharp, and you will see the benefit of being able to write Ext apps using code completion.


I am not sure I would use these libraries in a production application — yet. The one thing that they have going for them is that once they have generated Javascript for you, you could always stop using them. Then be in no different of a spot from hand coding Javascript yourself. I’m going to keep on eye on these tools and see how they progress.