March 2, 2010

OK, this is completely wonderful — exactly a thing I would have wanted to make, except somebody else made it for me, better. Keep this in mind in case anyone ever tells you the old yarn about how JavaScript is only a terrible language because of browser inconsistencies..

An example:

// be careful with those implicit .toString() calls in == comparison

typeof "abc" == "string" // true
typeof String("abc") == "string" // true
String("abc") == "abc" // true -- same types get casted to equal each other

String("abc") instanceof String // false -- hmmm...
(new String("abc")) instanceof String // true
String("abc") == (new String("abc")) // true -- wait, wtf?
Comments Off

CPython in the web browser under Native Client

June 17, 2009

Towards: the replacement of JS as an anachronistic relic? The story on LWN:

Mark Seaborn has announced an effort to put CPython into Google’s Native Client. “I have been doing some work to extend Google’s Native Client to support dynamic linking. For those who haven’t heard of it, Native Client is a sandboxing system for running a subset of x86 code. It is proposed as a way of running native code inside web apps. One of my aims has been to get CPython working in the web browser under Native Client without having to modify CPython. I recently got to the point where modules from the Python standard library are importable under Native Client, including (as a demonstration) the Sqlite extension module.

Comments Off