News for hackers. Stuff that matters.
Re:Show HN: My x86 emulator written in JavaScript by staunch on Thursday October 17, 2013 @05:09PM (#6568139)
This may as well be magic as far as I'm concerned. When I first saw http://bellard.org/jslinux/ I just about shat myself. This is definitely another level of awesome. Well done.
Re:Show HN: My x86 emulator written in JavaScript by ghayes on Thursday October 17, 2013 @05:28PM (#6568257)
This really is extremely well done [and I'd like to see the unminified source]. The next feature I'd want to see is networking support. I love the idea to be able to run my entire dev setup in an emulated browser session [e.g. ruby, rails, redis]. That would be a game changer on how I'd develop.
Re:Show HN: My x86 emulator written in JavaScript by javanix on Thursday October 17, 2013 @05:31PM (#6568274)
At 2000 kIPS you may have a few generations of javascript engines to go before we get there.

That's not meant to take away from this project - it truly is amazing what can be interpreted in the browser now.

Re:Show HN: My x86 emulator written in JavaScript by tekacs on Thursday October 17, 2013 @06:05PM (#6568464)
Just for reference's sake this does vary a fair bit by computer and browser - mine never drops below ~8kIPS and runs mostly at ~15kIPS (and up to ~23kIPS).

Whilst this is nothing like the several orders of magnitude required for more capable interactive behaviour, it does make my load times noticeably faster than those claimed on the page. :)

(I'm Chrome on Linux, i7 4th Gen, incidentally)

Re:Show HN: My x86 emulator written in JavaScript by kuschku on Thursday October 17, 2013 @06:26PM (#6568582)
I'm getting here > speed 1640kIPS on the old Nexus 7, don't you mean 8kkIPS?

(This value was the average while booting Linux)

Re:Show HN: My x86 emulator written in JavaScript by Hello71 on Thursday October 17, 2013 @08:04PM (#6569005)
psst, the SI prefix for 10^6 is M
Re:Show HN: My x86 emulator written in JavaScript by antsar on Friday October 18, 2013 @01:11PM (#6572496)
You mean to say, 10^7 isn't KKK?
Re:Show HN: My x86 emulator written in JavaScript by tekacs on Friday October 18, 2013 @07:07AM (#6570734)
Absolutely so, yes. Thanks. :)

8 - 23 MIPS ain't so bad, right?

Re:Show HN: My x86 emulator written in JavaScript by wnesensohn on Friday October 18, 2013 @07:34AM (#6570805)
For reference, that's about as fast as a Motorola 68030 @50MHz [1] which was used in the AppleIIx, and while that was no slouch when it was released, you wouldn't want to run a modern development environment on such a machine either ;)

[1] http://en.wikipedia.org/wiki/Motorola_68030

Re:Show HN: My x86 emulator written in JavaScript by dkersten on Saturday October 19, 2013 @02:20PM (#6577274)
A little faster than an Arduino and a little slower than a PIC24. Not too bad.
Re:Show HN: My x86 emulator written in JavaScript by gngeal on Thursday October 17, 2013 @05:44PM (#6568337)
Dynamic translation of x86 sequences could give you some boost, as could use of asm.js.
Re:Show HN: My x86 emulator written in JavaScript by Dylan16807 on Thursday October 17, 2013 @05:54PM (#6568402)
Some things would do badly at that speed. But serving basic web queries would be fine, and give you a better feel for what is slow when milliseconds spent processing turn into actual seconds.
Re:Show HN: My x86 emulator written in JavaScript by benjamincburns on Saturday October 19, 2013 @03:32AM (#6575677)
I'm presently working on networking (OpenCores ethmac) support for the jor1k[1] OpenRisc emulator. The plan is to push ethernet frames out over a web socket, and pipe them into a tun interface on the server via a node/python/C/whatever backend. From there, do whatever you want using your OS' standard networking tools (if you have specific needs for the server-side of this which go beyond using your os' standard tools, please let me know).

If you're interested in this, please do make plenty of noise at me to finish. I've got a flight back to the East coast from Portland on Sunday, so I'm hoping I can get most of the browser code finished by then. After that I'm going to be somewhat distracted through the end of January, as I'm moving from Charleston, SC to Christchurch, New Zealand. I could use a bit of motivation to get this done.

1: http://s-macke.github.io/jor1k/

Re:Show HN: My x86 emulator written in JavaScript by s-macke on Saturday October 19, 2013 @04:32AM (#6575788)
I am really looking forward. If you have any wishes for an image with some tools, please let me know. Lynx, elinks, dillo, ssh, netcat, telnet ... whatever you want. Then I have to think about a demo. Maybe we can allow very limited access to some websites.
Re:Show HN: My x86 emulator written in JavaScript by benjamincburns on Monday October 21, 2013 @08:26AM (#6584999)
I think the biggest thing I'm overlooking right now is randomized MAC generation. I need to take a look at whether or not the ethoc driver will attempt to read the MAC from hardware before loading its own. If so, I can randomize MACs in my ethmac.js, or even make a backend service assign them to guarantee uniqueness.

Otherwise I think it'd be great to get an image together with all of those tools, especially Lynx. It'd be great if I could make the HN submission to the demo page via the emulator itself. However for now if I can get an ICMP echo I'll be happy.

I think when it's ready I'm going to set up a full-access reCaptcha-protected demo on DigitalOcean or AWS and see what happens. If people don't abuse it and if the bill isn't too bad, I'll leave it up. If not, I'll worry about how to do a restricted demo. It would be nice to get a network-friendly game in there, though.

Another great demo that we'd have difficulty with is browser-in-browser. Chrome-in-chrome, firefox-in-firefox. That would, however, be the ultimate sandbox.

Anyway, get in touch with me via e-mail or better yet, Skype (see profile). We can coordinate better there.

Re:Show HN: My x86 emulator written in JavaScript by RaphiePS on Thursday October 17, 2013 @07:12PM (#6568801)
I think it would be really cool to link this up with some of the Chrome App API's (TCP/UDP networking, serial). Then you could distribute lightweight programs without bothering with Emscripten or Native Client.
Re:Show HN: My x86 emulator written in JavaScript by rrrene on Friday October 18, 2013 @04:41AM (#6570378)
> That would be a game changer on how I'd develop.

Why? I'm honestly curious since I can't imagine any big advantages over more "classic" setups ...

Re:Show HN: My x86 emulator written in JavaScript by vidarh on Friday October 18, 2013 @05:19AM (#6570460)
Go to any machine with a browser, log in, and have your dev environment pop up in the same state it was when you left it somewhere else, yet all running locally rather over some VNC connection or potentially laggy ssh connection. Log out, and have the state persisted.
Re:Show HN: My x86 emulator written in JavaScript by bkanber on Friday October 18, 2013 @09:28AM (#6571211)
I use a remote dev server that behaves exactly like this, except it's just a hosted virtual server. What advantage would doing this in JS give you?
Re:Show HN: My x86 emulator written in JavaScript by nitrogen on Saturday October 19, 2013 @04:17AM (#6575756)
I think Sun workstations did that in the 80s or 90s.
Re:Show HN: My x86 emulator written in JavaScript by benatkin on Saturday October 19, 2013 @04:15AM (#6575752)
Or PHP.

Ruby's interestingness to performance ratio is not high.

Re:Show HN: My x86 emulator written in JavaScript by chris_mahan on Thursday October 17, 2013 @05:40PM (#6568323)
Absolutely. This would be awesome.
Re:Show HN: My x86 emulator written in JavaScript by stonewhite on Friday October 18, 2013 @06:47AM (#6570680)
Must plug http://www.koding.com here.

It is a "social" development platform supporting rails, mysql etc.

Re:Show HN: My x86 emulator written in JavaScript by acqq on Friday October 18, 2013 @02:24AM (#6570073)
I just ran Bellard's JSLinux (#) on my retina iPad with iOS 7. It works! Booting took 15 sec. Claims 20 bogoMips. And I can type the commands in it and execute them:

First I tap to the edit box on the right, the keyboard rolls in, then I tap in the "console." The commands work. I just don't know how I'd type ctrl-Keys without the physical keyboard.

Copy.sh ends with unimplemented GP handler however for anything I've tried.

#) JSLinux: the PC emulator is written in Javascript with the emulated hardware: 32 bit x86 compatible CPU, 8259 Programmble Interrupt Controller, 8254 Programmble Interrupt Timer, 16450 UART, Real Time Clock, IDE interface and hard disk. http://bellard.org/jslinux/tech.html

Re:Show HN: My x86 emulator written in JavaScript by chubot on Thursday October 17, 2013 @06:17PM (#6568539)
Wait how does this differ from JSLinux? Aren't they doing the same thing?

Also, this isn't just an x86 emulator, right? If it can boot linux, it's emulating the entire PC platform, not just x86. Very impressive of course. But I am interested in a comparison vs jslinux (also not open source).

Re:Show HN: My x86 emulator written in JavaScript by g3 on Thursday October 17, 2013 @06:40PM (#6568654)
Yes, it's very similar to the jslinux project. However, I added more hardware (it can boot a real bios: seabios). Also, I'll make this open source.
Re:Show HN: My x86 emulator written in JavaScript by tectonic on Thursday October 17, 2013 @11:27PM (#6569605)
Very much looking forward to the open source release!
Re:Show HN: My x86 emulator written in JavaScript by chii on Friday October 18, 2013 @12:54AM (#6569837)
great to hear you are opensourcing this!

I had a quick look at the minified source. its pretty hard to decipher (method names have been renamed too), unlike traditional minification which you can recover by just reformatting.

Re:Show HN: My x86 emulator written in JavaScript by annnnd on Friday October 18, 2013 @02:47AM (#6570119)
AFAIK most of minificators also shortened variable / function names - are there any that don't do this? (take a look at minified jquery.js for instance)
Re:Show HN: My x86 emulator written in JavaScript by Groxx on Friday October 18, 2013 @03:02PM (#6573325)
minification can't (usually) happen on the public side of the API - that could explain jQuery, as a very large amount of it is public.

Otherwise yeah, you can just run it through a whitespace-remover. There are also often options on e.g. the YUI compressor: http://refresh-sf.com/yui/ and Google's: http://closure-compiler.appspot.com/home

Re:Show HN: My x86 emulator written in JavaScript by jhgaylor on Friday October 18, 2013 @04:24AM (#6570324)
Css get minified by removing whitespace because the keywords are important.. Javascript can have some magic done to it to reduce character count because only the consistency of the keywords matters.
Re:Show HN: My x86 emulator written in JavaScript by why-el on Thursday October 17, 2013 @07:33PM (#6568881)
Keep us updated when you do. :)
Re:Show HN: My x86 emulator written in JavaScript by simida on Saturday October 19, 2013 @10:07PM (#6578726)
wait for you to open the source.
Re:Show HN: My x86 emulator written in JavaScript by _ak on Thursday October 17, 2013 @05:46PM (#6568349)
With emscripten, anything is possible nowadays. And it blows your mind.
Re:Show HN: My x86 emulator written in JavaScript by facorreia on Thursday October 17, 2013 @06:34PM (#6568622)
Anything has been possible since 1999. Anything at all.

http://www.zombo.com

Re:Show HN: My x86 emulator written in JavaScript by NIL8 on Thursday October 17, 2013 @10:43PM (#6569484)
I can't stop laughing. That was so weird and funny that I almost forgot what I was doing here on HN.
Re:Show HN: My x86 emulator written in JavaScript by Mithrandir on Thursday October 17, 2013 @10:48PM (#6569495)
Relevant xkcd: http://xkcd.com/855/