Fabrice Bellard has released a JavaScript program that can run Linux in a Web browser window.

(Credit: Screenshot by Stephen Shankland/CNET)

Step aside, Google Docs, there's a new JavaScript tour de force in town.

I'm talking about the latest project from programmer Fabrice Bellard, a JavaScript program that emulates an x86 processor fast enough to run Linux in a Web browser.

The JavaScript PC Emulator can do the work of an Intel 486 chip from the 1990s, but doesn't have a built-in floating point unit for numeric processing, Bellard said. Happily, Linux itself can emulate that, and a version of the operating system's core--2.6.20--runs on the foundation.

Bellard published a technical description of the JavaScript PC Emulator on Saturday, but today the project caught the notice of prominent techies, including Brendan Eich, a Mozilla programmer and the creator of JavaScript.

"I did it for fun, just because newer JavaScript engines are fast enough to do complicated things," Bellard said of the project. "I happen to be interested by the implementation of JavaScript engines these days--but I don't know yet if I will write my own any time soon! Anyway, this emulator was a way to learn how to write optimized code for recent JavaScript engines, in particular JaegerMonkey (for Firefox 4) and V8 (for Chrome)."

Bellard suggests some possibilities for more serious use, including benchmarks or running old DOS games. But probably the project's biggest practical repercussion is simply the news that JavaScript has matured enough to run an entire computer-within-a-computer.

Curious people can try the emulator with a modern browser that has fast JavaScript performance' it works with Firefox 4 but not newer versions of Google Chrome. And those who really want to dig in can look at the JavaScript PC Emulator's actual JavaScript code.

The project is the latest attention-getter from Bellard. The French programmer also wrote QEMU, software that can emulate one type of processor on another' FFmpeg, open-source software for playing and otherwise handling video and audio streams' QEmacs, a lightweight text editor for Unix systems' digital TV signal generator software that uses a computer's VGA card to broadcast TV over the air' Linmodem, Linux software that emulates a hardware modem chip' and a program that calculated pi to a then-record 2,699,999,990,000 digits using a mere personal computer.

Bellard also is a two-time winner of the Obfuscated C competition to produce clever but superficially incomprehensible programs in the C language.


Discuss   Add this link to...  Bury

Comments Who Voted Related Links