Hacker News new | ask | show | jobs
by colanderman 5278 days ago
I don't get it. What's with all the reimplementations of stuff in Javascript (and WebGL for that matter)? I understand that the Web is the next big platform, and the Javascript is currently the lingua franca of the Web. But it doesn't make any sense that vast collections of working code that happens not to be written in Javascript should be reimplemented to fit this straightjacket.

It makes far more sense for the community to focus on the development of translators -- compilers -- from other languages to Javascript, and on the optimization of Javascript engines to run such translated code. I know such systems exist (most notably for Java and C), so I'm confused by the disproportionate amount of press stories like this one get.

Of course I'm ignoring the fact that one may wish to rewrite code in Javascript because they find the language interesting. I can't say I'm one of those people.

(Note: I don't mean this to knock the author's work. Writing emulators is interesting and fun, and I'm sure he did a good job of it. But a Game Boy emulator in Javascript (the language) is no more interesting than a Game Boy emulator in PHP. The interesting part is that it is a Game Boy emulator in Javascript (the platform), which IMO should not necessitate a reimplementation of a Game Boy emulator in Javascript (the language).)

3 comments

You are definitely thinking a step ahead. Being able to compile existing programs directly would be great. If someone is successfully using those translators I'd like to see it.

Porting or re-implementing these kinds of oddball programs is a way to explore the possibilities. How fast can Javascript really run? Are the graphics APIs sufficient? Should browsers support USB joysticks? Cameras? In other words, helping to see where the straightjacket is loose. And, ideally, encouraging the browser developers to cut some of the straps.

Trying to compile code to JavaScript results usually in sub-optimal performance. You have to manually do it to tweak the best performance out of the language. It's kinda retarded, but it's analogous to writing assembly code for performance critical apps. Also, I did it for the lulz.
Yeah, this seems totally pointless. I could play GBC (and GBA) games using a Windows program with no problems nearly a decade ago. But this JS implementation lags in Firefox 9 on a computer that's just a few years old.

Why does everything have to be on the web? As with most other things, a mixed approach is the best one.