Honest question: why (is it beyond I was bored, so I did it because I could)?
A Brainfuck to WebAssembly compiler and playground
11–20 of 20 posts
Re: A Brainfuck to WebAssembly compiler and playground
#12Earlier quoted context omitted.
Moreover, the Lost Kingdom interpreter will expand the memory arbitrarily as it encounters > instructions, whereas the bf2wasm interpreter has a fixed limit of 16384 4-byte cells according to its documentation.
Oh, you are right; I simply overlooked that part of the readme. In my opinion that should have been 8-bit cells mainly because AFAIK simulating 16-bit or 32-bit in 8-bit cells is reasonable [1] but doing the other way without slowing it down too much is highly dependent to the program. [1] https://esolangs.org/wiki/Brainfuck_bitwidth_conversions
Re: A Brainfuck to WebAssembly compiler and playground
#13Re: A Brainfuck to WebAssembly compiler and playground
#14I 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.
Re: A Brainfuck to WebAssembly compiler and playground
#15I 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.
Chrome does nothing with asm.js; it's Firefox who applies special, faster compilation routines to asm.js code.
Re: A Brainfuck to WebAssembly compiler and playground
#16I 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.
Chrome does nothing with asm.js; it's Firefox who applies special, faster compilation routines to asm.js code.
Re: A Brainfuck to WebAssembly compiler and playground
#17Re: A Brainfuck to WebAssembly compiler and playground
#18Earlier quoted context omitted.
Oh, you are right; I simply overlooked that part of the readme. In my opinion that should have been 8-bit cells mainly because AFAIK simulating 16-bit or 32-bit in 8-bit cells is reasonable [1] but doing the other way without slowing it down too much is highly dependent to the program. [1] https://esolangs.org/wiki/Brainfuck_bitwidth_conversions
I didn't know about the idiom of using [+] for zeroing. Are the cells supposed to be signed ?
[+] should always overflow to 0 at some point, which is entirely doable for 8 bit, but less so for 32bit. as for choosing between [-] and [+] you'll just have to guesstimate if 0 or intmax is on average closer to your value.
Re: A Brainfuck to WebAssembly compiler and playground
#19I 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.
Chrome does nothing with asm.js; it's Firefox who applies special, faster compilation routines to asm.js code.
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.
Re: A Brainfuck to WebAssembly compiler and playground
#20Earlier quoted context omitted.
Chrome does nothing with asm.js; it's Firefox who applies special, faster compilation routines to asm.js code.
Not sure about Chrome, but the support in Chromium has already been shipped last year: https://bugs.chromium.org/p/v8/issues/detail?id=4203