4 ms·
LLVM to JS compiler- kripken/emscripten
- wahnfrieden 15y agoPrevious discussion: http://news.ycombinator.com/item?id=2428723 http://news.ycombinator.com/item?id=2428723
- azakai 15y agoThe main update since then is this demo of Doom in JS: https://developer.mozilla.org/en-US/demos/detail/doom-on-the-web/ https://developer.mozilla.org/en-US/demos/detail/doom-on-the...
- wahnfrieden 15y agoCool, didn't realize that was emscripten. Here's the post discussing this demo by emscripten's author http://syntensity.blogspot.com/2011/05/emscripten-12-doom-on-web.html http://syntensity.blogspot.com/2011/05/emscripten-12-doom-on...
- rcfox 15y agoIt's not really clear to me how graphics are being displayed. I assume they're not converting SDL/OpenGL to Javascript. Is there a Canvas library you can link, or something?
- georgemcbay 15y agoThe link that wahnfrieden posted talks about an SDL/JavaScript port, so presumably yes that's how they are doing it. OpenGL wouldn't be involved, though, Doom is old-school 2.5D raycasting to a simple framebuffer. Unfortunately in keeping with the recent theme of cool web demos not actually working for most web users, none of the browsers I tried even run the demo. Tried it on IE9, Chrome and Firefox (obviously Firefox is supported, but it seems like you need a bleeding edge Nightly version).
- azakai 15y ago> Tried it on IE9, Chrome and Firefox (obviously Firefox is supported, but it seems like you need a bleeding edge Nightly version). I tested on Firefox 4 and 7 and both worked, so there must be something else wrong. Are there any JS errors? Also, any idea why it doesn't work in IE9? I was hoping it would.
- georgemcbay 15y agoI've since manually updated to Firefox 4.0.1 and it is working now, not sure what the issue was previously, could have been a local config thing. On IE9 it reports: SCRIPT1028: Expected identifier, string or number index.html, line 7 character 7 SCRIPT438: Object doesn't support property or method 'indexOf' doom.cc.js, line 20 character 63 SCRIPT5007: The value of the property 'clearConsole' is null or undefined, not a Function object index.html, line 73 character 9
- azakai 15y agoThanks for the IE9 info!
- azakai 15y agoEmscripten implements SDL in JavaScript, rendering to a Canvas element. It supports both RGB and fixed palettes. There is also some experimental work to translate (a subset of) OpenGL to WebGL.
- rcfox 15y agoThat's pretty awesome then! I'll have to try it on some of my stuff.
- jxcole 15y agoCool idea. They are taking the LLVM and making more back ends. It would be cool if they could support as many back-ends as Haxe. I've developed in Haxe before and I can say I much prefer it to writing in javascript directly. I hope these projects can continue. I look forward to the day when I can compile in any language to any platform. Different languages have different strengths. It is unfortunate that these days our choice of language is tethered to the platform we wish to deploy on. Haxe: http://haxe.org http://haxe.org
- Hrundi 15y agoI'm converting a N64 emulator (mupen64plus) to JS and I find it to be very challenging and fun! I would love to get it to a point of running an actual game instead of just demos. Hopefully, I'm not far from it. I surely hope to be able to create a post here titled 'Show HN: etc...' For the heck of it, I'm also attempting to translate a N64 emulator (Jario64) from Java to C# and then JS with Script# Its crazy that we've gotten to this point, and I intent to enjoy every single thing about it and help moving this forward. Edit: formatting