Mitty is a Brain*uck to WASM compiler and runtime.
https://utatti.github.io/mitty/
Install:
npm i -g @utatti/mitty
Prepare a Brain*uck code:
>++++++++[-<+++++++++>]<.>>+>-[+]++
>++>+++[>[->+++<<+++>]<<]>-----.>->
+++..+++.>-.<<+[>[+>+]>>]<---------
-----.>>.+++.------.--------.>+.>+.
Run mitty
:
# JavaScript interpreter
mitty interpret hello.b
# WASM compiler
mitty compile hello.b hello.wasm
mitty exec hello.wasm
Node.js >= 12 is needed to run ES Modules natively.
The test cases in the /test directory are copied from the following repository. They have their own licensing.
- WebAssembly Specification
- Brainfuck Optimization Strategies by Mats Linander