4 ms·
I love it! I've been working on a brainfuck to asm.js compiler myself and it's a great learning experience, even if asm.js will be going away in favor of wasm (
by daxterspeed 9y ago
I love it! I've been working on a brainfuck to asm.js compiler myself and it's a great learning experience, even if asm.js will be going away in favor of wasm (though I believe Chrome compiles asm.js into wasm).
I'm excited to hear about how you intend to solve input instructions. I've been struggling with that myself since I want to make it asynchronous, which might require some nasty tricks.
- verdie-g 9y agoI guess I will add an input in the playground and copy its content to an extra wasm memory page. Then I'll track the input's index with a new local. I realized after coding that first version that most brainfuck programs run indefinitely. Apart from Hello World, I didn't find lots of program I could run synchronously. Making it asynchronous sounds like a tough job.
- seba_dos1 9y agoChrome does nothing with asm.js; it's Firefox who applies special, faster compilation routines to asm.js code.
- TomMarius 9y agoNot sure about Chrome, but the support in Chromium has already been shipped last year: https://bugs.chromium.org/p/v8/issues/detail?id=4203 https://bugs.chromium.org/p/v8/issues/detail?id=4203
- seba_dos1 9y agoOh, so it changed! Didn't know that, thanks. When playing with Emscripten, I'm still seeing asm.js working noticeably faster in Firefox than in Chromium, so I just assumed that it's still how it was for years :)
- aaroninsf 9y agoWeb assembly is now supported across all major browsers.
- mort96 9y agoasm.js is not webassembly.
- daxterspeed 9y agoIt was announced in V8 6.1 that asm.js could be validated and compiled to WebAssembly. https://v8project.blogspot.se/2017/08/v8-release-61.html https://v8project.blogspot.se/2017/08/v8-release-61.html To be fair I don't think this announcement ever spread that far and I don't think it was ever announced that the validation would be enabled in Chrome, nevertheless I see asm.js validation messages (or rather, invalidation messages when there's issues) in Chrome 64.