Something Interesting. Javascript x86 emulator

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
cxzuk
Member
Member
Posts: 164
Joined: Mon Dec 21, 2009 6:03 pm

Something Interesting. Javascript x86 emulator

Post by cxzuk »

Heya all!

Something i think everyone should have a go with and to take apart! A javascript x86 emulator from the creator of qemu, tcc, ffmpeg and much more. :)

Fabrice Bellard - A truly talented programmer.

http://bellard.org/jslinux/
UX
Posts: 15
Joined: Sun May 08, 2011 2:21 pm

Re: Something Interesting. Javascript x86 emulator

Post by UX »

I saw that on LWN yesterday...I will just quote him:
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 Jaeger Monkey (for Firefox 4) and V8 (for Chrome).
Wow...does this guy even eat?
What do you think, how much it would take you to program a C complier, VM, mpeg lib, and PC emulator in ugly js...a lifetime?
I feel dumb.
cxzuk
Member
Member
Posts: 164
Joined: Mon Dec 21, 2009 6:03 pm

Re: Something Interesting. Javascript x86 emulator

Post by cxzuk »

His organisational skills must be amazing. Most of my time is pretty much wasted time.

http://www.softwarequalityconnection.co ... rogrammer/
UX
Posts: 15
Joined: Sun May 08, 2011 2:21 pm

Re: Something Interesting. Javascript x86 emulator

Post by UX »

Thanks for the article...it can all be summed up with this one:
” Bellard doesn’t appear to promote himself" -> and that is the key...usualy programmers, eventhoug they are very interested in coding, as soon as they gain some knowledge, they like to show off and scream about it.
Difference is, Bellard obviously has much _love_ for his job and love is always very creative and simple, humble.
Just look at his homepage...plain HTML with projects that can put almost any company, programmer to shame.

Yeah...very rare role model in this industry. I bet he's an exceptional person too.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Something Interesting. Javascript x86 emulator

Post by Love4Boobies »

UX wrote:Wow...does this guy even eat?
What do you think, how much it would take you to program a C complier, VM, mpeg lib, and PC emulator in ugly js...a lifetime?
I feel dumb.
There are people on this very forum who have already accomplished more than that. I'm not trying to imply that Fabrice Bellard isn't a good programmer, I'm just saying that it's not all that uncommon at all. Also, note that he's not magically developing a bajillion projects at once; most of them are either unmaintained or have other maintainers now.

As for JS, it's a pretty good language and its usage outside client-side programming (i.e., for application programming and even for systems programming) has greatly increased in the last couple of years. I recommend that you look into it.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Something Interesting. Javascript x86 emulator

Post by Solar »

Love4Boobies wrote:As for JS, it's a pretty good language...
*cough*

Ahem.

I beg to differ.

JavaScript is successful, and it does have advantages, but being "a pretty good language" (as language per se) is not one of them.

In this, it can be grouped with e.g. Perl: It does the job it was designed for, and can be used for things it wasn't designed for, and it might even be the best choice because "everybody knows it" and tremendous work has been done with regards to frameworks and support libraries, but technologically it's a second-rate citizen.
Every good solution is obvious once you've found it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Something Interesting. Javascript x86 emulator

Post by Solar »

Even stupidity can be standardized (and certified, ref. ISO 9001...).

But to each his own. I wouldn't touch JavaScript with a ten-foot-pole, but that's just me.
Every good solution is obvious once you've found it.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Something Interesting. Javascript x86 emulator

Post by Owen »

JavaScript - or, rather, ECMAScript - is just a Lisp in C/Java's clothing. It is a very elegant language, with acknowledgement that using doubles as the only number representation was probably a mistake. It has its flaws, but, well, it was implemented on a deadline; if it hadn't been, something worse would have happened.

Browser-based JavaScript, however, is a different matter...
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Something Interesting. Javascript x86 emulator

Post by Love4Boobies »

Indeed. It's nothing like Perl---most people have bad preconceptions regarding JavaScript (I was guilty of this as well), but after using it for a little while, one starts to realize that it's better than most general-purpose programming languages out there. I would also recommend it for systems programming. Programming is not the place for preconceptions.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Something Interesting. Javascript x86 emulator

Post by Combuster »

Owen wrote:Browser-based JavaScript, however, is a different matter...
Which is exactly why I wouldn't touch it with that 10-foot pole Solar mentioned. A language is worthless if you can't trust its implementation.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Something Interesting. Javascript x86 emulator

Post by Love4Boobies »

Combuster wrote:
Owen wrote:Browser-based JavaScript, however, is a different matter...
Which is exactly why I wouldn't touch it with that 10-foot pole Solar mentioned. A language is worthless if you can't trust its implementation.
Well, there are good implementations of it. That aside, I don't really agree with you on this one. While good tools are clearly very important, generally speaking, good design & poor implementation -> everyone says the thing is useless -> unpopular -> no good implementations (ever?).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Something Interesting. Javascript x86 emulator

Post by JamesM »

Solar wrote:
Love4Boobies wrote:As for JS, it's a pretty good language...
*cough*

Ahem.

I beg to differ.

JavaScript is successful, and it does have advantages, but being "a pretty good language" (as language per se) is not one of them.

In this, it can be grouped with e.g. Perl: It does the job it was designed for, and can be used for things it wasn't designed for, and it might even be the best choice because "everybody knows it" and tremendous work has been done with regards to frameworks and support libraries, but technologically it's a second-rate citizen.
Am I the only person who really likes Javascript's purity? Classes are functions, everything is in weak JSON... The things that frameworks like jQuery can do with it are rather incredible.

I know some V8 developers, and there are a good number of things that make Javascript a *pig* to write a compiler for, but as a programmer... I like it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Something Interesting. Javascript x86 emulator

Post by Love4Boobies »

@JamesM: I think we've already established that most of us like it.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
miker00lz
Member
Member
Posts: 144
Joined: Wed Dec 08, 2010 3:16 am
Location: St. Louis, MO USA

Re: Something Interesting. Javascript x86 emulator

Post by miker00lz »

an x86 emu in javascript... that is twisted and abnormal. somebody needs to put it out of it's misery! seriously though, that is pretty cool. i haven't tried it, but i'm going to guess the performance isn't very good.

i've always had huge respect for bellard, the guy is seriously talented.
User avatar
Neolander
Member
Member
Posts: 228
Joined: Tue Mar 23, 2010 3:01 pm
Location: Uppsala, Sweden
Contact:

Re: Something Interesting. Javascript x86 emulator

Post by Neolander »

Well, the sample code is fast, but it is quite limited, and the emulator has several major limitations due to performance concerns already (e.g. no FPU emulation, no real mode so probably no BIOS emulation either...)
Post Reply