Wednesday, 22 June 2011

Why No Alternatives to JavaScript?

This is a question whose answer I can't find.

When you put some JavaScript in a web page, you use this syntax:

<script type="text/javascript">
    document.write("Hello World!")
</script>

You explicitly state that this is JavaScript.

It's been 16 years since JavaScript was invented. Why have no alternative languages been developed and added to HTML? Clearly HTML allows for the possibility. JavaScript is a language created in ten days, launched without time to go through a "are we really doing this a good way" phase. Hence there are several bad things in JavaScript. An more rigorously developed alternative would be valuable.

CoffeScript exists. But this must be compiled into JavaScript before adding to a web page.

 

3 comments:

  1. Vendor support. There were other initiatives but they all required a download of a plugin, which is annoying.

    So developers went for the language that every browser has, javascript.

    ReplyDelete
  2. What Johan said.

    There are lots of Foo-to-llvm-to-JavaScript projects on the internets though.

    ReplyDelete
  3. I'm pretty sure IE supported VBScript in the browser and other languages using the active scripting interfaces. I doubt that was what you were hoping for though :)

    It would be nice to run Python or Ruby in the browser, especially if that is what you are using server side.

    ReplyDelete