Stevebook - [ javascript_as_a_target ]
JavaScript as a target

Now that JavaScript is getting so insanely fast, it's starting to look more and more interesting for purposes other than just doing a bit of dynamic HTML and AJAX on web sites. Things like the canvas tag for doing graphics help too.

Here's a few links of weird uses for JavaScript where its its new-found speed will come in handy:

JavaScript (or ECMAScript) is looking more and more interesting as a target for compiling code — it's a powerful, dynamic language, and you get a runtime which has several implementations both open-source and proprietary and is already installed on millions of computers and can be run right on a web page without requiring installation or anything complicated that would typically get in between an application and its users.

  • The haXe language can target JavaScript
  • HotRuby is an implementation of Ruby to run in JavaScript
  • GWT allows writing server-side and client-side in Java, but the client-side part gets compiled to JavaScript
  • ScriptSharp compiles C# code to JavaScript
  • This article describes a system to compile C, through LLVM, to JavaScript!
  • Pyjamas does something similar to GWT, but for Python.

Now if only there was a browser standard to allow JavaScript access to the audio hardware, we could do browser-based audio synthesis with it! I haven't seen any dicussion of this exact topic, though I imagine that in the meantime Flash 10 could be used for this purpose. (But I'd prefer something that doesn't depend on a plugin! Even if Flash is so widely deployed..)