JavaScript: Now powerful enough to run Linux

on jueves, 19 de mayo de 2011
Fabrice Bellard released a JavaScript program that can run Linux in a Web browser window.

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


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.

FONT: http://news.cnet.com/8301-30685_3-20063563-264.html

6 Respuestas:

_ dijo...

Nice blog, followed!

Anónimo dijo...

Finally, Java actually has a use now.

Chance Porter dijo...

Linux? In my Java?

It's more likely than you think.

Unknown dijo...

Amazing!

ruinz dijo...

Great, mix 2 of the languages I have no idea how to program
How to Hack Life.

Mike dijo...

whaat? does it work flawless?

Publicar un comentario