Retro Roundup: Old Computers Emulated Right In Your Browser
An anonymous reader writes: If you ever wanted to program an Altair, an Apple I, or a COSMAC ELF you may think you either have to buy one (expensive now) or load and configure simulation software. However, there's a slew of browser-based emulators for everything from a PDP-11 to Windows 1.0 out there. Some use Java, but many use Javascript and many perform better on a modern PC then they did in their original. If you want to learn some history or just want to finally play with the computers you saw in the magazines 35 years ago, these are great fun and slightly addictive.
The problem, as I see it, is that by doing it in Javascript, we're introducing a new dependency: the code will only work on a browser produced in 2015.
Well you can rest easy then, because no one is writing this stuff in JavaScript.
What triggered this change is Emscripten, which is a back end for LLVM that targets ... JavaScript. Actually it targets asm.js, which runs at about 1/2 native speed in Firefox (not so fast in Chrome, because Google thinks the solution to the same problem is NaCl).
What that means is any compiler that uses LLVM can now compile to asm.js. Which means any program written in Python, Rust, Go (there are a whole pile of languages) can now be compiled to run in the browser. In particular Clang is a C compiler for LLVM. Dosbox is a x86 + MSDOS emulator, written in C. Ergo Dosbox can now be compiled to JavaScript and this run in the browser. Js-dos is a site apparently dedicated hosting games that does just that. The game console emulators are also written in C. So they to can and now have been compiled to asm.js. Because modern web browsers support WebGL, OpenGL games that have been open sourced (like Quake3) have also been compiled to JavaScript, and run spookelly well. Which is how we get to the plethora of games mentioned in the article. Pity it didn't mention the technology behind it.
But why stop a games? Sqlite3 has been recompiled for Javascript. It can do in browser SQL queries in about 2ms, and is a damned site nicer to use than wandering through a spiderweb of Javascript objects. But why stick to something sane? You can now do ffmpeg encoding in your browser.