News for hackers. Stuff that matters.
Re:Douglas Crockford on JavaScript and HTML5 by scrrr on Monday September 27, 2010 @08:37AM (#1731461)
Apparently everyone is happy with Javascript, or there would be different scripting languages on the client-side. Apparently it wasn't an issue whether Javascript should be used in HTML5.

Technically a <script type="text/python"> shouldn't be impossible either.

Re:Douglas Crockford on JavaScript and HTML5 by olavk on Monday September 27, 2010 @09:05AM (#1731511)
I don't think everyone is necessarily happy with JavaScript, but it is the de-facto standard, and there is no realistic alternative.

Sure, we could add a new language, but with various competing implementations we will probably get at least the same amount of interoperability problems as we have had with JavaScript.

And because of backwards compatibility browsers will still have to support JavaScript indefinitely in addition to the new language.

Re:Douglas Crockford on JavaScript and HTML5 by RyanMcGreal on Monday September 27, 2010 @08:55AM (#1731493)
It's not technically impossible but it would be challenging to get all the browsers to support embedded Python, not to mention versioning issues (does IE10 target Python 2.5, 2.6 or 3.1?).
Re:Douglas Crockford on JavaScript and HTML5 by bobds on Monday September 27, 2010 @09:12AM (#1731540)
This feature is already here: Appcelerator's Titanium

It supports Python, Ruby, PHP and you can do things like <script type="text/python"> or <script type="text/ruby" src="myfile.rb"/>. They have made an underlying object system that can act as a bridge between Javascript and Python/Ruby/PHP, it's called Kroll.

Kroll's source code has been released: http://github.com/appcelerator/kroll

Obviously, there are bound to be multiple gotchas when using such a bridge between languages, nevertheless I thought it was pretty impressive the first time I saw it.

http://developer.appcelerator.com/doc/desktop/python

Scroll to the bottom of the page for an example of using jQuery via Python.