Log in

No account? Create an account
Previous Entry Share Next Entry
Okay, that carries the compile-to-Javascript thing to a whole new level

Yeah, sure, I've gotten used to the notion that Javascript is nowadays best treated as an object format, using the browser as its "hardware" -- enough so that I believe the next version of Querki's UI is going to be written in Scala and compiled to Javascript.

But the point has just been driven home to me by discovering that someone has (several years ago, in fact) compiled Linux to Javascript, along with an emulator of an x86 PC for it to run on, and built a complete virtual machine inside the browser. And I don't mean a little toy subset of Linux -- for giggles, I typed "emacs hello.c", and by god it booted freaking Emacs inside of my browser. It runs like mud, of course, but this is very much one of those "it's a wonder the bear dances at all" moments.

I think I need to re-evaluate my definition of the word "platform". If you can run a PC emulator, running an operating system, running a huge and complex program, all inside of a browser window, the game has definitely shifted...

  • 1
(Deleted comment)
Granted, but there is a gulf of difference between That Which Is Provably Possible and That Which Works In Practice. Important changes to the tech landscape rarely have to do with someone doing something that was theoretically impossible before. They are usually about someone noticing that something that was previously *impractical* is now reasonable.

I mean, Javascript's always been Turing-complete in theory, and it's always been hypothetically possible to do this -- if you had an impossibly fast machine, an impossible amount of memory space and an at least implausibly fast network connection. Knowing that you can *actually* do stuff like this, though, on a consumer-grade machine, is a whole different ballgame.

And yes, it's a somewhat silly project, but the author explicitly did it as an exploration of what you could accomplish with current Javascript tech. (The project was mainly the PC emulator, actually; then he simply compiled Linux to that emulator and wrote a few bindings.) In that light, it's pretty interesting, and firmly cements the "Javascript is best thought of as machine code" viewpoint, IMO...

  • 1