Something Interesting. Javascript x86 emulator
Something Interesting. Javascript x86 emulator
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/
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/
Re: Something Interesting. Javascript x86 emulator
I saw that on LWN yesterday...I will just quote him:
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.
Wow...does this guy even eat?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).
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.
Re: Something Interesting. Javascript x86 emulator
His organisational skills must be amazing. Most of my time is pretty much wasted time.
http://www.softwarequalityconnection.co ... rogrammer/
http://www.softwarequalityconnection.co ... rogrammer/
Re: Something Interesting. Javascript x86 emulator
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.
” 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.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Something Interesting. Javascript x86 emulator
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.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.
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 ]
[ Project UDI ]
Re: Something Interesting. Javascript x86 emulator
*cough*Love4Boobies wrote:As for JS, it's a pretty good language...
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.
Re: Something Interesting. Javascript x86 emulator
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.
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.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Something Interesting. Javascript x86 emulator
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...
Browser-based JavaScript, however, is a different matter...
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Something Interesting. Javascript x86 emulator
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 ]
[ Project UDI ]
- Combuster
- 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
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.Owen wrote:Browser-based JavaScript, however, is a different matter...
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Something Interesting. Javascript x86 emulator
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?).Combuster wrote: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.Owen wrote:Browser-based JavaScript, however, is a different matter...
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Something Interesting. Javascript x86 emulator
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.Solar wrote:*cough*Love4Boobies wrote:As for JS, it's a pretty good language...
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.
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.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Something Interesting. Javascript x86 emulator
@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 ]
[ Project UDI ]
Re: Something Interesting. Javascript x86 emulator
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.
i've always had huge respect for bellard, the guy is seriously talented.
Re: Something Interesting. Javascript x86 emulator
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...)