757 B
757 B
Gir is an optimizing brainfuck interpreter in Javascript.
Name
𒌋𒀜 gir (Sumerian) - n. kiln
License
Everything in the repo is under Unlicense / CC0.
Status
Gir can parse and prettyprint to Javascript console programs in brainfuck. Gir supports following optimizations:
- Turn runs of +- or <> into one command
- Turn [-] or [+] into one command
- Add offsets to commands that modify tape, to reduce moving tape head
TODO
- Implement
:;#
- Optimization pass to turn multiply loops into commands that do
x += y * c
- Make VM use a Proxied object that gives out 0 for nonexistent elements for its memory
- Implement UTF-8 I/O
- Allow cycle maximum to be passed to
run()
- Keep a cache of compiled programs in
run()