I can count the number of lines of Javascript I have written on, well, 20 hands. The core language makes sense to me, nevertheless: apparently Javascript sucks volumes (volume one and volume two).
My take on Javascript is that it could well be the next Postscript: over time, more of it will be generated than written by hand. Worse is better.
7 comments:
Generating Javascript? Yuck. Despite its problems, the tendency I've been seeing is away from generation. It's got a whole bunch of warts, but it's still a high-level language.
"Generating Javascript? Yuck."
Worse is better. Javascript is what we've got for cross-platform, semi-rich-client user interfaces.
And so who wants to code what can be reused? Perhaps "generated" is not the best word choice... I think "reused" is more likely.
The easiest way to turn an ugly language to a nice one is to write a compiler or interpreter for the nice language which targets the ugly one.
http://fresh.homeunix.net/~luke/jscm/repl.html
http://fresh.homeunix.net/~luke/jscm/scm.js.txt
"XUL"
AJAX has a lot of momentum right now across browsers. I would look for more XUL-like features to emerge out of a more "standard" AJAX approach rather than momentum to shift anytime soon to XUL per se.
"Scheme in JS"
I'd prefer Scheme. Either way though one has to program around or over most of the faults described in the referenced web pages.
Compiling other languages to Javascript means utterly abandoning debuggability. That's a non-starter. And issues like the annoying nature of the DOM aren't Javascript's fault at all, and new languages won't fix that.
Javascript has a couple problems. They are very annoying; things like lack of modularity. Code generation doesn't solve those problems, it only compounds them. It creates a walled world of your generated library, and you are cut off from anyone else's code. That's fine in a word processor; that's a horrible compromise for a rich client programming interface.
It's far more useful to spend time coming to terms with Javascript's warts and learning to deal with them. That's knowledge you can continue using and carry with you to any Javascript project. Code generation is a kind of hubris in comparison.
Here's an interesting development. You can now target javascript from perl6.
Post a Comment