Sunday, October 16, 2011

Not Everything Needs To Run In A Web Browser

So recently I stumbled upon a Gameboy emulator written in javascript. It barely runs at full speed in Chrome on my 3.4 Ghz CPU. Using a hacky but fast emulator on my 200 Mhz Pentium CPU years ago, I was able to get full speed without any hiccups. You know, maybe I shouldn't be saying this as a developer of web applications, but JavaScript is a pretty lousy language to have to write an application in. Not just because it's ludicrously slow for anything that takes any real amount of CPU power, but also because you pretty much have to shoehorn your ideas into the limited interface JavaScript and HTML5 provide. For instance did you know that in order to play dynamically generated audio in your web browser, the best method currently enabled involves packaging your audio into a WAV file and sending it to and <audio> tag via a base64 URL? Now why didn't I think of that...

Seriously guys, there is a reason people still write things using compilable languages. As it turns out, they're pretty fast, and they tend to have much more coherent API's for doing application type things than JavaScript provides. Personally my favorite way to write a program is a Ruby application with a command line interface. It's not compilable, but it has great APIs. And I can actually replace functions with versions written in C where speed it needed. Keeps things simple, and keeps me productive. As opposed to spending weeks developing an inferior version of something that already existed that will never run at fun speed on any platforms for which it might have been slightly useful. Don't worry guys who develop web standards, I'm sure you'll get it right eventually.

No comments:

Post a Comment