ASCII by Jason Scott

Jason Scott's Weblog

Javascript Hero: A Hero Appears —

Last October, I gave a call to arms on this very weblog to help port MESS to Javascript.

Five months later, I want to share a working protoype.

So, with the caveat of it only working in the Google Chrome browser, of it only showing you a single Colecovision cartridge, and of it having no sound or keyboard input, allow me to introduce to you the working prototype at:

http://jsmess.textfiles.com/

If it doesn’t work for you, then I’ll tell you it looks like this:

The rest of this entry is just discussing the details, the repercussions, and the plans for this project. Summary: FUCKING AWESOME.

Obviously, the half-dozen people working on this project weren’t spending all waking hours in the last five months on getting us to where we are now. In a few cases, weeks went by as people lived lives, or we were waiting for someone to get off work, or just the occasional miscommunication and “oh hell, I thought you were doing the git push” sort of thing. The main project discussion, for a long time, has been here, if the nuts and bolts of the shared development project interests you.

The primary push has been to use the Javascript converter Emscripten to port MESS over to Javascript, and making that happen required a lot of bugfixes, some on the MESS side but also on the Emscripten side. It also required modifying makefiles, disabling assembly language routines, and bumping into all sorts of oddness. The primary developers of this whole project have been Justin de Vesine, Alon Zakai, and Justin Kerk, although there’s a lot more who have stuck their noses in in various fashions. Some stuck their noses in to tell us this was all impossible; the less said of those folks, the better.

The resulting Javascript file, mess.js, is 16 megabytes. Due to modern browser capabilities, it is pre-compressed down to 2 megabytes for transfer, but then it expands, and we run into the current situation that this sucker horks a ton of RAM. (In fact, it appears this does run in some versions of Firefox, but it really wrecks it when doing so, so I’m not going to count it.) This is, like I said, the prototype. We’re just working to make it function, and then we’ll expand back into making it function well and be much more efficient.

What’s important to me is that the prototype, the proof-of-concept, is an emulation of a Colecovision running a homebrew cartridge, Cosmo Fighter 2, by Marcel De Kogel. It’s a Colecovision running in a window! We chose Cosmo Fighter 2 because it kicks into a demo mode immediately, needing no keypress, so you can see the scrolling starfield and the text and the general speed of the thing right away. It bodes well. Obviously, as we head upward into more contemporary systems (the MESS emulator emulates such late-model systems as well as really old ones), the slowdown going through javascript going through a browser going through an OS may in fact be legitimate murder. But let’s not get ahead of ourselves with the fault-finding.

What we have here is Pat Crowther yelling “We Have Cave!“. It’s Neil Armstrong going “Holy shit“. It is a seriously big deal and it’s going to get bigger.

I think people forget how we used to tell people how things sounded and how they looked. We used to tell people this new song was really awesome. Now we can not only link to that song, we can link to a specific part of that song. And we might have said we saw something funny or amazing on a show, and we can now embed that specific event right into a webpage, and show them. OK. you probably sort of get how incredible that is, or at least that it happens, but sit back and think again what that does: it means that items of a visual and audio nature are as ubiquitous as the words we used to describe those items. This song is awesome; listen to how awesome this song is. This dude is fucking hilarious on this show; see how hilarious he is. Or, if your bend is more academic: this bird emits a unique cry; here is the cry it emits. The algorithm results in a very interesting outcome – come see the algorithm’s visual result.

As we press forward on JSMESS, the Javascript MESS project, we’re proposing to do the same to computing experience. We’re going to make things that happened on computers into an embeddable object on computers. Yes, you can certainly download a disk image, download an emulator, run the disk image on the emulator and then be able to see an old program run, but that’s a lot different than, say, putting up 10 windows in a webpage where if you click on any of them, you can immediately see what every major spreadsheet program on the Apple II looked and felt like. It’s nothing near as awesome as being able show you how Print Shop developed over the years. Or let you see, side by side, how the Atari and the Apple version of a program behaved. Once we’re done here, it’ll be trivial, a calling with a few options, a pittance of effort. The experience of any moment of computing in the past 50 years as an embeddable object. And once we’re done with that… then we can focus on the really amazing stuff.

While the team has things under control right now, it never hurts to have a few more people hang out and see what’s going on. The work is being discussed on the EFNet IRC network, in the channel #jsmess. If that doesn’t sound like your cup of tea, that’s fine. I’ll keep you appraised of future milestones.

Everything’s going to change.

It’s going to be very exciting.

 


Categorised as: computer history

Comments are disabled on this post


9 Comments

  1. Andrew Ross says:

    Seems to work fine in Safari on my computer (MacBook Air, OS X 10.7.3)…

  2. muriloq says:

    http://www.naclbox.com/ seems to be a much better alternative to do the same thing.

    • Jason Scott says:

      NaCL is a Google Chrome project – we’re working to make this work in any browser that has Javascript capability, or at least most of them. So right now, they’d be neck and neck, but that’s not staying that way.

  3. Justin de Vesine says:

    It doesn’t work in Safari 5.1.3 (for the curious, it has a dependence on Float64Array, which was not yet available in Safari 5.1.3’s version of webkit), but it works just fine in Safari 5.1.5.

  4. azakai says:

    NaCl isn’t just Chrome-specific: It only runs on x86 and x86_64. You can’t run NaCl on Chrome on ARM phones and tablets, nor PowerPC game consoles if Chrome ever runs on them.

    The JSMESS project uses pure JS so it will eventually run everywhere the web runs – in all browsers, on all CPUs.

  5. Justin Kerk says:

    Also NaClBox seems to be a port of DosBox which is cool and all but that’s one platform (DOS-based PCs). MESS emulates hundreds of platforms, many of which are not popular enough to get separate emulators, let alone separate browser ports.

  6. Coderjoe says:

    I forget, can MESS emulate a 386 computer running DOS? It would be awesome to be able to embed old PC demos in web pages, rather than having to try and track down a video or download a standalone emulator to run the thing.

  7. Justin Kerk says:

    It certainly can emulate a 386 PC, although sound support is still rudimentary and overall compatibility is not as high as DOSBox yet. As you get up into 486 and higher the performance is likely to be inadequate for the JavaScript version but you never know.

  8. thx1138 says:

    This has nothing to do with your post but I also wanted to add another Arcade:

    http://twitter.com/#!/ARCADEasheville

    Their website isn’t up to date but the Twitter feed seems to be. Was a quaint place I discovered a few weeks ago on my first visit to Asheville NC. They have something called Arcade Hero one night.