Now what if we could get X11 running in this thing?
May 17, 2011 1:08 AM   Subscribe

Boot linux in your browser (here's how/why). Works on Firefox 4 and Chrome 11 on Linux/Windows/Mac.
posted by azarbayejani (112 comments total) 64 users marked this as a favorite
 
Things Fabrice Bellard has done in the past:
    FFmpeg (used by basically anything that needs to play video)
    QEMU (used by Xen, Virtualbox, and other virtualization tools)
    tcc (Tiny C Compiler)
    The fastest algorithm to calculate an arbitrary digit of pi, as well as at one point having the world record for calculations of pi
posted by azarbayejani at 1:15 AM on May 17, 2011 [11 favorites]


what happens if you open a browser in the emulated linux and then boot another linux? what happens if you do it again?
posted by brenton at 1:21 AM on May 17, 2011 [6 favorites]


Neat. Really neat. Use it to boot FreeDOS and play your favourite old DOS games anywhere...
posted by rodgerd at 1:23 AM on May 17, 2011


Bellard is from the future. Not just any future, but one where beings of pure binary exhale optimised microcode and write compilers in a single verse of haiku.
posted by Devonian at 1:38 AM on May 17, 2011 [10 favorites]


I will never use this for anything, but I'm still wowed by its awesomeness.
posted by pompomtom at 1:38 AM on May 17, 2011 [3 favorites]


Seems to be using the terminal, rather then a graphical system, so no graphics stuff. Ah well.
posted by delmoi at 1:39 AM on May 17, 2011


Bellard is from the future. Not just any future, but one where beings of pure binary exhale optimised microcode and write compilers in a single verse of haiku.
Check out his load_binary function:
ea.prototype.load_binary=function Je(Ke,ha){var Le,Me,fd,i,Ne;Le=new XMLHttpRequest();Le.open('GET',Ke,false);if(Le.hasOwnProperty('responseType')){Le.responseType='arraybuffer';}else{Le.overrideMimeType('text/plain; charset=x-user-defined');}Le.send(null);if(Le.status!=200&&Le.status!=0){throw"Error while loading "+Ke;}if(Le.mozResponseArrayBuffer){Me=Le.mozResponseArrayBuffer;}else if(Le.hasOwnProperty('responseType')) Me=Le.response;}else{Me=Le.responseText;}fd=Me.byteLength;Ne=new Uint8Array(Me,0,fd);for(i=0;i
Actually this looks like it's been minified, which is a way of packing javascript to make the download size smaller (while at the same time making it impossible to read)
posted by delmoi at 1:43 AM on May 17, 2011 [1 favorite]


Wow. I stand in awe. Both of the technical achievement of writing such an emulator in JavaScript, and also the technical achievement of browser JS engines being good enough to pull it off.

Simply wow.
posted by mathw at 1:53 AM on May 17, 2011 [4 favorites]


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?
posted by zardoz at 2:05 AM on May 17, 2011 [1 favorite]


All my browsers are either too old or incompatible. Oh well.
posted by haroon at 2:06 AM on May 17, 2011


Totally amazing. With support for WebSockets and appropriate drivers this could make for a most insane Javascript SSH client. Bellard is a prodigy.
posted by eeeeeez at 2:06 AM on May 17, 2011 [2 favorites]


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?

Well, you could run firefox on it.
posted by sebastienbailard at 2:09 AM on May 17, 2011 [11 favorites]


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?

There is not much practical or theoretical use, other than that you can marvel at it. It's almost like a work of art, I guess.

I can imagine this could be a great starting point to teach people about UNIX basics such as shell syntax and the GNU toolchain. You could have a tutorial with in-line examples, showing you how to modify system configurations and perform basic operations and get instant feedback. It'd be 100% "real" without any potential to damage anything and without requiring the user to leave the browser at all.
posted by eeeeeez at 2:12 AM on May 17, 2011 [7 favorites]


The ultimate thin client.
posted by DU at 2:12 AM on May 17, 2011 [3 favorites]


I'm waiting for the javascript vax timeslice emulator so I can start up a virtual DeVry Institute of Technology.
posted by srboisvert at 2:13 AM on May 17, 2011 [4 favorites]


Well, you could run firefox on it.

I know you're joking, but without even CGA support... that doesn't seem likely.
posted by eeeeeez at 2:15 AM on May 17, 2011


Before I found out about this, I thought I was pretty smart.
posted by the painkiller at 2:18 AM on May 17, 2011 [4 favorites]


what happens if you open a browser in the emulated linux and then boot another linux? what happens if you do it again?

We need to go deeper.
posted by howlingmonkey at 2:20 AM on May 17, 2011 [19 favorites]


Well, you could run firefox on it.

sh: lynx: not found.
posted by PeterMcDermott at 2:30 AM on May 17, 2011 [3 favorites]


So cute!
And it comes with the traditional "Hello World"!

What can you do with it? Show it to people who think that javascript is just another punk language.
posted by fredludd at 2:55 AM on May 17, 2011 [2 favorites]


Is anybody able to figure out where the ampersand is on this keyboard? I was going to see if I could fork bomb my browser.
posted by azarbayejani at 3:13 AM on May 17, 2011 [1 favorite]


& is in the right place, it just prints as '"'.
~ # sleep 60 "                                                                  
~ # jobs                                                                        
[1]+  Running                    sleep 60                                       
~ #                                                                             
I got tired of my fork bomb in C, got up to around PID 14k.
posted by zengargoyle at 3:21 AM on May 17, 2011


We need to go deeper.

It's penguins all the way down.
posted by UbuRoivas at 3:21 AM on May 17, 2011 [10 favorites]


Things like this are why computers sometimes scare me. How can a mere mortal keep up with all of this?
posted by InsertNiftyNameHere at 3:22 AM on May 17, 2011 [1 favorite]


function Je(Ke,ha){var Le,Me,fd,i,Ne; [...]


His names are bad and he should feel bad.
posted by Mr. Bad Example at 3:36 AM on May 17, 2011 [1 favorite]


(Unless the names are a minifier thing, in which case I should feel bad.)
posted by Mr. Bad Example at 3:37 AM on May 17, 2011


Mr. Bad Example, it's minifier's names.
posted by azarbayejani at 3:40 AM on May 17, 2011


This is cool.

Let me know when he gets VMS working on my toaster.
posted by double block and bleed at 3:42 AM on May 17, 2011 [1 favorite]


It is astonishingly neat, but past the initial Woah moment it's really just an emulator running some software under JS. Which says as much about what you can do with JIT compilers running on seriously swift hardware as anything else. Linux, we know, is just dandy on restricted machines.

More interesting is what you can do if you start to experiment with the x86 architecture. Want a new instruction? Write it.
posted by Devonian at 3:46 AM on May 17, 2011 [1 favorite]


Not just any future, but one where beings of pure binary exhale optimised microcode and write compilers in a single verse of haiku.

I don't want to live on this planet anymore.
posted by PapaLobo at 4:36 AM on May 17, 2011


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?

Shhhh...It really annoys the geeks when you ask what their awesome creations can actually do, or why you'd ever want to use it.
posted by Thorzdad at 4:40 AM on May 17, 2011 [2 favorites]


It has tcc on it. And I was able to compile hello.c and run it.

It has both vi and emacs!
posted by Obscure Reference at 4:50 AM on May 17, 2011


azarbayejani: "Is anybody able to figure out where the ampersand is on this keyboard? I was going to see if I could fork bomb my browser."

I fork bombed it, but I had to change:

:(){ :|: & };:

to

f(){ f|f & };f

Where, as mentioned above, the & displays as a "

This neither crashed Firefox 4 nor completely pegged the processors on my machine, though, of course, the tab with the shell had to be closed when I was done.

Maybe I'll increase root's process limit later and see what happens. Or open 16 linux emulator tabs and forkbomb each. Or do all of that in a virtual machine. Inside another virtual machine...

Or eat breakfast. All this recursion is making me hungry!
posted by double block and bleed at 4:51 AM on May 17, 2011 [3 favorites]


However, it lacks any man pages.
posted by Obscure Reference at 4:52 AM on May 17, 2011 [3 favorites]


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?

Shhhh...It really annoys the geeks when you ask what their awesome creations can actually do, or why you'd ever want to use it.


Parents too are peeved when one asks what the use is of their newborn child. Such impractical people, geeks and parents.
posted by DU at 5:00 AM on May 17, 2011 [18 favorites]


I am genuinely awed.
posted by jaduncan at 5:08 AM on May 17, 2011 [1 favorite]


Wow, just wow!
posted by amil at 5:11 AM on May 17, 2011 [1 favorite]


So my plan is to boot Linux in my browser.

Then when I'm in Linux, I'll start up another browser, and boot Linux in there.

And then I'll start up another browser in there, and boot Linux in that.

And then I'll start a browser inside that Linux, and boot another Linux in that browser.

And that's where I'll hide my Margaret Thatcher pictures.

I N C E P T I O N
posted by Sutekh at 5:24 AM on May 17, 2011 [3 favorites]


Note for people like me: I think the "why" refers to "why he did it, not why I (or you) would be interested in doing so. Seems to me like the equivalent of being able to have your microwave's LCD screen play Space Invaders. There's a definite "Ha! How the hell did you do THAT?" factor, but I doubt the average person is going to appreciate anything but the most far-reaching implications.

(not thread-shitting or achievement-shitting here, just hopefully providing a conduit to those people for whom this endeavor may not provide an appreciable benefit for quite some time)
posted by ShutterBun at 5:40 AM on May 17, 2011


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?

Well, you could get frustrated while trying to do any number of simple tasks.
posted by TrialByMedia at 5:50 AM on May 17, 2011 [10 favorites]


Let me know when it starts rewriting itself.
posted by blue_beetle at 5:55 AM on May 17, 2011


Nifty - but.... Doesn't Linux run on ARM/RISC? Why go with the incredibly nasty, masochistic x86 instruction set? ...oh... wait....
posted by jkaczor at 6:00 AM on May 17, 2011


Note for people like me: I think the "why" refers to "why he did it, not why I (or you) would be interested in doing so. Seems to me like the equivalent of being able to have your microwave's LCD screen play Space Invaders. There's a definite "Ha! How the hell did you do THAT?" factor, but I doubt the average person is going to appreciate anything but the most far-reaching implications.

Here's a use case for you - you can run legacy software in the browser now, and update the company to a non-terrible OS version (YMMV on what that is). The bigger news is that QEMU runs in the browser - eventually Windows will too.
posted by jaduncan at 6:00 AM on May 17, 2011 [1 favorite]


I've already thought of a number of practical uses for this concept. Explaining them would take too long and interrupt my play time.
posted by humanfont at 6:05 AM on May 17, 2011


what happens if you open a browser in the emulated linux and then boot another linux? what happens if you do it again?

Douglas Hofstadter appears and gives you a ten minute lecture on Strange Loops.
posted by A dead Quaker at 6:14 AM on May 17, 2011 [1 favorite]


It's not so much the Linux part as the CPU emulation part that's important. Playing old Dos games in the browser would probably be the first practical (for some definition of 'practical') use.
posted by empath at 6:18 AM on May 17, 2011


If anyone wants to watch or help some people over at 4chan's /g/ (tech) board right now they are trying to run (or install) Gentoo inside of the emulation. Here's the link to that thread. I'm a Linux noob but it's fun to watch them try to figure it out. I think they are mostly having a problem with the memory allotment set by the kernel.
posted by coolxcool=rad at 6:25 AM on May 17, 2011 [2 favorites]


Sweet jesus this is amazing. It's the kind of thing I imagine one of my really, really smart computer science classmates (I am far more a middle of the pack type) would have done for a fun side project.
posted by antifuse at 6:25 AM on May 17, 2011


Here's a use case for you - you can run legacy software in the browser now, and update the company to a non-terrible OS version (YMMV on what that is). The bigger news is that QEMU runs in the browser - eventually Windows will too.

OK, by "people like me" I meant "people not quite so savvy as me."

I see above me that "playing old DOS games in the browser" seems to be a prime selling point. If that's the case I'll say "well done!" But hasn't " playing outdated games in browsers" been going on for some time?

Again, I don't wanna crap on the achievement here, but as a casual/semi hardcore computer user this strikes me as a case of "could we" winning out over "why should we."
posted by ShutterBun at 6:34 AM on May 17, 2011


Well, you can just get back on the plane then, Dr. Malcolm.
posted by BeerFilter at 6:37 AM on May 17, 2011 [1 favorite]


this strikes me as a case of "could we" winning out over "why should we."

And what's the harm in that, in this case? It's not like he built a nuclear bomb.
posted by DU at 6:38 AM on May 17, 2011 [1 favorite]


Again, I don't wanna crap on the achievement here, but as a casual/semi hardcore computer user this strikes me as a case of "could we" winning out over "why should we."

No, I have a sense this is tremendously useful. I just have no idea what for yet.
posted by eeeeeez at 6:39 AM on May 17, 2011 [1 favorite]


Especially if you combine this with Google Chrome's Native Client tech that got some coverage on the blue recently.
posted by eeeeeez at 6:42 AM on May 17, 2011 [1 favorite]


Well, you can just get back on the plane then, Dr. Malcolm.
posted by BeerFilter


Well, we are talking about cloning dinosaurs, aren't we?
posted by ShutterBun at 6:44 AM on May 17, 2011 [1 favorite]


When Acutely Focused Minds Meet Turing Complete Languages. This is fantastic.

For those complaining that this is not graphical, it probably could be. Observe: noVNC, an encrypted VNC client implemented with HTML5 and JavaScript using the new WebSockets and Canvas APIs. Here are videos and screenshots. That's enough proof for me that a browser-based graphical Linux install is a technical possibility from a rendering standpoint. Or if you don't want to do that, just browser-VNC into your browser-Linux from another tab.
posted by Songdog at 6:48 AM on May 17, 2011


:(){ :|:& };: && .
posted by mhoye at 6:52 AM on May 17, 2011


For those complaining that this is not graphical, it probably could be.

There's also jsVNC. So in theory we should be able to VNC from one browser tab to another.

Jesus.
posted by mhoye at 6:53 AM on May 17, 2011 [1 favorite]


Can I use this to hack the Gibson?
posted by Bonzai at 6:56 AM on May 17, 2011 [3 favorites]


I see above me that "playing old DOS games in the browser" seems to be a prime selling point. If that's the case I'll say "well done!" But hasn't " playing outdated games in browsers" been going on for some time?

Those were done in Java, not javascript.
posted by empath at 6:58 AM on May 17, 2011


what happens if you open a browser in the emulated linux and then boot another linux? what happens if you do it again?

you get a beowulf cluster of javascript pc emulators.
posted by quonsar II: smock fishpants and the temple of foon at 7:03 AM on May 17, 2011 [2 favorites]


mhoye: "There's also jsVNC."

And ThinVNC, Guacamole, WebNC, and probably others (possibly based on common code; I haven't looked that deeply). They're multiplying!

blue_beetle: "Let me know when it starts rewriting itself."

I wonder if they are writing themselves ...
posted by Songdog at 7:08 AM on May 17, 2011


jcreigh: "I've always wanted to do "rm -rf *" in the root of a linux box."

We've had virtual machines for a while now. Go grab virtual box and an Ubuntu VM and knock yourself out. Just make a snapshot first.
posted by pwnguin at 7:10 AM on May 17, 2011


This is what I love about engineers: They don't see something useless but awesome like this and say "well, sure it's useless but it's better than useful IT'S ART"; they say "yeah, kinda useless, but hey--awesome, right?"

So sick of artists.
posted by Joseph Gurl at 7:12 AM on May 17, 2011 [2 favorites]


This is what I love about engineers: They don't see something useless but awesome like this and say "well, sure it's useless but it's better than useful IT'S ART"; they say "yeah, kinda useless, but hey--awesome, right?"

It's only useless for now. There's a lot of potential here.
posted by thsmchnekllsfascists at 7:20 AM on May 17, 2011


Don't forget emscripten, which is a JavaScript LLVM frontend. (In layman's speak, this lets you do things like compile C into JavaScript)

Some insane examples :
Python
Raytracer
Physics sim
JPEG 2000 Renderer
FreeType
A full-fledged PDF Renderer (Warning. 12MB)
posted by schmod at 7:21 AM on May 17, 2011 [4 favorites]


lets you do things like compile C into JavaScript

GNU guile, which implements scheme, can also execute JavaScript and I
believe the plan is to implement other languages as well. The idea
being that you can write plugins (guile is the official embedded
language of GNU) in any language you want. The weird thing will be
when large projects have massively heterogeneous codebases that All
Just Work (if they do).
posted by DU at 7:26 AM on May 17, 2011


Some insane examples :
Python


Yeah, this is what I'm talking 'bout. Python, converted from C to Javascript and running in my browser. And it actually works. I don't care how "useless" this is, this whole thread has earned Javascript, a language I've always hated and can barely write "Hello World" in, complete respect in my mind.

Now to try and use this emscriptem thing on R....
posted by Jimbob at 7:29 AM on May 17, 2011 [1 favorite]


More impressive to me than the fact that this is Linux running in a browser is that it's a PC EMULATOR WRITTEN ENTIRELY IN JAVASCRIPT. That is just f'ing hardcore, and there's no *reason* for some super genius like Bellard to do it, other than "Hey why not, because I can?" - super geniuses do crazy things like this for fun. And here I am barely finding the time to mow my lawn once a week.

*pokes brain with a q-tip* Smarten up dammit!
posted by antifuse at 7:52 AM on May 17, 2011 [10 favorites]


Javascript is getting really cool... I mean, soooo much effort has gone into speeding up those javascript engines and the results are spectacular. This particular project, while pretty amazing, isn't so important in and of itself, but it does show nicely that you can build really complicated stuff in the browser and have it run reliably on millions (billions?) of machines.
posted by ph00dz at 7:56 AM on May 17, 2011


No tclsh, but who's complaining?
posted by newdaddy at 7:59 AM on May 17, 2011


So this is like a kernel turducken? Sweet.
posted by Inspector.Gadget at 8:04 AM on May 17, 2011 [5 favorites]


I''d use it as a ssh client from any machine anywhere. Normally I have to download putty which is fine but some machines don't allow downloads or get raised eyebrows. I was once kicked out a public library in Nevada for downloading putty on their public terminals (but that was years ago and these days it's kinda silly to use the library for internet access considering other options).
posted by stbalbach at 8:07 AM on May 17, 2011 [1 favorite]


It has tcc on it

Oh, thanks. I was looking for gcc and couldn't figure out why he'd give us gcc without the means to compile!

I wish it had ssh, though.
posted by pjenks at 8:09 AM on May 17, 2011 [1 favorite]


oops, meant "why he'd give us hello.c without the means to compile"
posted by pjenks at 8:09 AM on May 17, 2011


> Well, you could run firefox on it.

I know you're joking, but without even CGA support... that doesn't seem likely.


What on earth do you need graphics for?
posted by Galaxor Nebulon at 8:16 AM on May 17, 2011 [1 favorite]


I got kicked out of a library in Indiana in 1996ish for chatting with one of those robots from a university AI lab (I forget which one) that answered your questions in almost meaningful ways. The librarian said the Internet was only for serious research, not for playing around.

I asked her if she thought that AI wasn't a serious intellectual pursuit worthy of research. She gave me a blank stare and then pointed towards the door.

If I knew then what I know now, I might have come back the next day to seriously research what placing a hidden fork bomb batch script as an auto-run on all three workstations would be like (there was no security).

I'm glad I didn't. That would have been an overly shitty thing to do to all of the honest people looking for the weather and cookbook recipes.
posted by double block and bleed at 8:28 AM on May 17, 2011 [1 favorite]


Seems to me like the equivalent of being able to have your microwave's LCD screen play Space Invaders.

That sounds pretty awesome to me and a completely worthy pursuit of time. I guess this is why I'm not like normal people.
posted by zachlipton at 8:31 AM on May 17, 2011 [2 favorites]


It's not so much the Linux part as the CPU emulation part that's important. Playing old Dos games in the browser would probably be the first practical (for some definition of 'practical') use.

Think Dosbox has been done recently. Linux or another OS could be considered the ultimate compatibility test
posted by ConstantineXVI at 8:37 AM on May 17, 2011


oops, meant "why he'd give us hello.c without the means to compile"

tcc is the compiler he included.
posted by Galaxor Nebulon at 8:49 AM on May 17, 2011


Penguins all the way down.
posted by Stagger Lee at 8:57 AM on May 17, 2011


There's a really awesome practical application to this. You can represent an entire useful computing environment as a web page. Any locked-down "web-only" machine becomes general purpose again. Today it's a stripped-down command-line environment (an extremely useful thing in its own right), but that won't last.
posted by Zed at 8:58 AM on May 17, 2011 [3 favorites]


What on earth do you need graphics for?

Yeah, I thought about aalib, too, then I saw that this thing does not emulate any graphics adapter whatsoever, not even text mode - what you are seeing is the emulated serial port I/O.

... which is another sign of Bellard's utter brilliance IMHO - it's the thought: "well, I really don't need a graphics adapter, do I?" that is so brilliant.
posted by eeeeeez at 9:01 AM on May 17, 2011


What a beautiful hack. I get 20 BogoMIPS! That's roughly 1/200th the speed of my hardware server. It's interesting that his CPU has the F00F bug simulated. FDIV and HLT both work right though.

Shame there's no network device.
posted by Nelson at 9:10 AM on May 17, 2011


BTW, this profile of Fabrice Bellard is worth a read. The man truly is superhuman. I'm impressed by his 2002 IOCCC winner, otcc.c. It's a self-hosting C compiler/linker in 3301 bytes of source code.
posted by Nelson at 9:17 AM on May 17, 2011


I wonder how long the page will take to load after someone ports KDE to it?
posted by double block and bleed at 9:18 AM on May 17, 2011


> Shhhh...It really annoys the geeks when you ask what their awesome creations can actually do, or why you'd ever want to use it.

Frequently, the important work does not come with anything outwardly impressive -- think for a moment about how visually impressive the original public version of Linux was.

The Black Triangle is a good anecdote about retaining a sense of wonder when introduced to things that don't look how they'd look in a Hollywood version of it.
posted by ardgedee at 9:32 AM on May 17, 2011 [2 favorites]


Or, perhaps you're really oldskool and you'd like to run UNIX Sixth Edition in your browser using a javascript PDP-11 emulation?

(I think I worded that right... see FAQ. Yes you can compile programs. Don't catch your beard in that machine.)
posted by Twang at 9:33 AM on May 17, 2011 [2 favorites]


I've always wanted to do "rm -rf *" in the root of a linux box.

I keep threatening to print up a t-shirt which reads "sudo rm-rf /" for interviews with the caveat that I won't consider anyone who doesn't smirk or grimace, but when I made this comment about half my team gave me a blank look and I realized that I'd already let them into the department.
posted by quin at 9:45 AM on May 17, 2011 [5 favorites]


On the one hand, I can see some nice applications to this. I just designed a C++ course and struggled with ways to get the examples into the browser rather than downloaded. LAMP, python, or other libraries might be good as well.

On the other hand, how well sandboxed is this?

It also doesn't seem to work for me under OS X Chrome. Perhaps I need to update.
posted by KirkJobSluder at 9:57 AM on May 17, 2011


On the other hand, how well sandboxed is this?

It should be just as sandboxed as any other JS.
posted by thsmchnekllsfascists at 10:02 AM on May 17, 2011 [1 favorite]


How can you copy and paste from this command line?
posted by Obscure Reference at 10:08 AM on May 17, 2011


It should be just as sandboxed as any other JS.

And that's what scares me.
posted by KirkJobSluder at 10:13 AM on May 17, 2011 [1 favorite]


On the other hand, how well sandboxed is this?

It actually uses a zero day exploit to install ubuntu on your system, overwriting your existing os.
posted by sebastienbailard at 10:40 AM on May 17, 2011 [7 favorites]


Ok, from a total amateur when it comes to Linux and programming in general, what can I do with this?
posted by zardoz at 2:05 AM on May 17 [+] [!]
...
Totally amazing. With support for WebSockets and appropriate drivers this could make for a most insane Javascript SSH client. Bellard is a prodigy.>


There you have it. It could be a tool of the Resistance. SSH in a browser (where you're only allowed to use port 80, port 22 being the usual SSH port).


function Je(Ke,ha){var Le,Me,fd,i,Ne; [...]

His names are bad and he should feel bad.


function Do( Re, Mi ){ var Si, La, Do; }
posted by mmrtnt at 10:44 AM on May 17, 2011


I'd already let them into the department.

That rights escalation... it's coming from inside the department!
posted by Zed at 10:45 AM on May 17, 2011


/ #: whoami
root
must. fight. teenage impulses.

/ #: rm -rf *
/ #: ls
sh: ls: not found
posted by wcfields at 11:07 AM on May 17, 2011 [2 favorites]


Shhhh...It really annoys the geeks when you ask what their awesome creations can actually do, or why you'd ever want to use it.

Yeah, kinda.

But then we just get all smirky when a few years from now billions of you all are using our creations in your everyday life *cough* *cough*.

This is an amazing accomplishment, for a ton of reasons, but there's one thing here that really shows that Fabrice Bellard isn't just a Geek God, he's a God who wants others to build the Universe with him.

He included a C compiler (tcc) on the default example and the only file in your default directory is a C source sample.

With this release, he's not just saying "Look at this awesome thing I did." He's saying, "Look at this awesome thing I did. Now go create!" It's such a contrast to the walled garden philosophy that many are pushing, where the act of creation isn't encouraged, it's actively discouraged.

This really shows the web browser is a general purpose computing environment. Something that's been talked about since the days of Netscape and Java, but hard to grasp as a concept by some.
posted by formless at 11:28 AM on May 17, 2011 [5 favorites]




Shhhh...It really annoys the geeks when you ask what their awesome creations can actually do, or why you'd ever want to use it.


This IS cool though. You're running X86 inside a browser! That means, in theory, with enough resources, that you could run a lot of things inside a browser.
posted by Stagger Lee at 11:37 AM on May 17, 2011 [1 favorite]


Yeah, I thought about aalib, too, then I saw that this thing does not emulate any graphics adapter whatsoever, not even text mode - what you are seeing is the emulated serial port I/O.

If that terminal is a full-featured vt100 emulator, which I suspect it is, then you should have no trouble running the aalib X11 on it, even over a serial console.
posted by Galaxor Nebulon at 11:38 AM on May 17, 2011


I don't know why people are calling this useless. Off the top of my head, this seems like an excellent way to implement a sandbox learning environment for coreutils and the like, similar to SQLZoo. Normally this sort of thing requires a crazy amount of shell injection prevention, but here you can just give the user their own damn shell.

Unfortunately, there are restrictions on what JS can do via browser. You can't open connections to port 6667 for example. Even thought it would be totally cool to write a javascript IRC client.
posted by pwnguin at 11:45 AM on May 17, 2011


Again, I don't wanna crap on the achievement here, but as a casual/semi hardcore computer user this strikes me as a case of "could we" winning out over "why should we."

This strikes me as a functionally illiterate fan of reality TV berating James Joyce for not scripting Jersey Shore.
posted by rodgerd at 12:18 PM on May 17, 2011 [1 favorite]


Unfortunately, there are restrictions on what JS can do via browser. You can't open connections to port 6667 for example. Even thought it would be totally cool to write a javascript IRC client.

That's what WebSocket is all about. Unfortunately, it's disabled by default in Firefox and Opera until security holes are fixed in the spec (Chrome has said they will disable it too if an exploit appears), but the goal is definitely to let you do just what you're talking about here.

In the meantime, you can cheat and use jsocket, which uses a tiny hidden Flash file for the actual networking. There are a few other similar frameworks as well. Or use a serverside proxy.
posted by zachlipton at 12:33 PM on May 17, 2011 [2 favorites]


You know what I always thought would be cool? Setup a 'network' of machines as a game and people could try to hack eachother's gibsons. With this you could do it all in the browser.

This particular linux install only has lo up and running, but if you could probably do some kind of PPP connection using XMLHttpRequests to the main server.
posted by delmoi at 2:42 PM on May 17, 2011


This is our future: Virtual machines inside virtual machines... all the way down.
posted by blue_beetle at 2:55 PM on May 17, 2011


It has just occurred to me, that using either the x86 emulation method, or the emscripten method, you could potentially run an Apache web server inside your web browser.

My mind is going to continue to be blown by this all day.
posted by Jimbob at 3:33 PM on May 17, 2011


It has just occurred to me, that using either the x86 emulation method, or the emscripten method, you could potentially run an Apache web server inside your web browser.

Not Apache specifically, and not all of these are portable, but here's jsws , js_httpd, and Mozilla's httpd.js, a web server that runs inside Firefox that is used for unit testing of the browser.

For that matter, Opera Unite is mainly just a web server running inside the browser (along with separate Opera-hosted proxy and DNS servers to deal with NAT traversal and service discovery, along with a specification for Opera's Unite app APIs).

Now, we just need to run all of this in the cloud and we'll be even more buzzword compliant. Give that startup a Series A!
posted by zachlipton at 4:34 PM on May 17, 2011 [2 favorites]


Am I misreading it, or are 99% of the binaries hard links to busybox? Good gravy that project has legs. Everything but init, ldd, ldconfig, qemacs, and tcc from what I can tell..
posted by Kyol at 5:47 PM on May 17, 2011


It has just occurred to me, that using either the x86 emulation method, or the emscripten method, you could potentially run an Apache web server inside your web browser.

But could you connect to it from another tab?
posted by pompomtom at 12:08 AM on May 18, 2011


Kyol: "Am I misreading it, or are 99% of the binaries hard links to busybox? Good gravy that project has legs. Everything but init, ldd, ldconfig, qemacs, and tcc from what I can tell.."

Yep, busybox is the defacto embedded coreutils. Someday, I aim to figure out how they actually go about optimizing the thing.
posted by pwnguin at 7:41 AM on May 18, 2011


I'm having to the flashbacks to the project that brought the first wave of my friends out to California.
posted by tangerine at 10:27 AM on May 18, 2011


In the meantime, you can cheat and use jsocket, which uses a tiny hidden Flash file for the actual networking.

The only problem with that, other than its dependency on Flash, is that things like that break if the user has click-to-Flash installed (i.e., Flash plugins not being loaded until the user clicks on a placeholder image). Which is a sensible thing to have installed, given how Flash chews up CPU cycles and RAM and greatly enlarges one's security exposure. This is also a problem with some audio streamers which use AJAX for the UI but have it talk to a hidden Flash object (SoundCloud, for example).
posted by acb at 4:28 AM on May 19, 2011


The only problem with that, other than its dependency on Flash, is that things like that break if the user has click-to-Flash installed (i.e., Flash plugins not being loaded until the user clicks on a placeholder image). Which is a sensible thing to have installed, given how Flash chews up CPU cycles and RAM and greatly enlarges one's security exposure. This is also a problem with some audio streamers which use AJAX for the UI but have it talk to a hidden Flash object (SoundCloud, for example).

No idea if jsocket somehow cheats and gets around it, but Mozilla-based browsers absolutely, positively will not initiate a flash video unless it's visible to the user (and it's remarkably consistent about this behavior). If you hide or cover up the player with another element, the .SWF never gets loaded.

Ergo, it's not always safe to script Flash behind the scenes.

(I know this, because I was writing an app that, for a variety of reasons, was supposed to display a video player after the video had loaded, buffered, and was ready to play. The obvious way to do this seemed to be to have the player load while hidden, and then send a javascript command to the browser to show itself once it was ready. This works in Chrome, Safari, and even IE, but not Firefox. No amount of kludge-y workarounds would actually make Mozilla behave the way that I wanted it to.)
posted by schmod at 9:28 PM on May 25, 2011


« Older "No, no, you can just talk to the comedian anytime...   |   "People generally think you're mad... That's sort... Newer »


This thread has been archived and is closed to new comments