I haven't exactly finished setting this blog up yet, but an idea just occurred to me, and rather than jot it in my paper notebook, I thought I'd post it publicly for y'all to see.
This is probably a harebrained idea. I'm sure I'll see some flaws in it tomorrow, and you will see them even sooner.
Madcap idea: "Funky JavaScript" (FunkyJS):
I'm calling it "Funky" because it's func -> functional. And weird too.
Yeah, I'm demented to even consider this. But it falls right at the intersection of a whole bunch of problem domains that I've been looking at:
Erlang is very capable on the server. JavaScript is ubiquitous on the client side. If we could bridge this gap, perhaps some really interesting apps could emerge?
How about a multiplayer game like Scrabble or Battleship that works as a Facebook app, on iPhone, and every desktop web browser? How about massively-multiplayer, with tournaments and ranking and embedded advertising too? (ala Bejeweled or Pogo.com)
I'm talking about taking web technologies far beyond the level of "interaction" that we're accustomed to.
As Douglas Crockford says, "JavaScript is a sloppy language, but inside it there is an elegant, better language." His Little JavaScripter even demonstrates how to rewrite all functions from "The Little Schemer" into JavaScript. Thus, it should be possible to do the inverse (JS->Scheme) given a strict enough subset of JS.
Erlang is a functional language like Scheme, so hopefully JS->Erlang would be similarly possible.
I'm glossing over lots of details of how a "dynamic, run-anywhere, multiuser app" would work, of course. Think of it as an AJAX app with a critical enhancement: write code that runs on the client or on the server, however it suits your problem, with no performance penalty. Make the client as smart or dumb as necessary, and re-balance the client/server workload as you go. Possibly even on-the-fly.
Imagine Google Docs Spreadsheet doing simple calculations on the client, heavy calculations on the server. Maybe you push more calculations to the server when the client has a weak CPU like iPhone.
Ok, this is pretty sci-fi. But tools like Dashcode make AJAX programming awfully accessible. Is the rest so far-fetched?
Last note: Douglas Crockford's JSLint is a JavaScript syntax checker and validator, in JavaScript. His Pratt Parser may be a darn good model to follow.