"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Tuesday, July 19, 2005

The Next Postscript

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:

Ian Bicking said...

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.

Patrick Logan said...

"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.

Anonymous said...

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

Patrick Logan said...

"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.

Patrick Logan said...

"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.

Ian Bicking said...

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.

Anonymous said...

Here's an interesting development. You can now target javascript from perl6.

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.