An optimizing brainfuck interpreter in js
Go to file
Juhani Krekelä 00eb264cb4 Document writeInt, readInt, breakPoint 2018-05-27 12:32:18 +03:00
.gitignore First commit 2018-05-21 23:55:48 +03:00
README.md Keep a 16 program cache for ircbotRun() 2018-05-26 23:27:47 +03:00
UNLICENSE First commit 2018-05-21 23:55:48 +03:00
brainfuck.md Add :;# 2018-05-26 13:14:05 +03:00
gir.html Add correct charset info 2018-05-24 23:35:50 +03:00
gir.js Keep a 16 program cache for ircbotRun() 2018-05-26 23:27:47 +03:00
ir.md Document writeInt, readInt, breakPoint 2018-05-27 12:32:18 +03:00
optimizations.md Update documentation 2018-05-25 23:21:29 +03:00

README.md

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, prettyprint, and run 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
  • Turn multiply loops into one command

TODO

gir.js

  • Make VM and transformMultiplyLoops use a Proxied object that gives out 0 for nonexistent elements for tape and allows using [] interface
  • Support for other types of EOF?

gir.html

  • Implement a UI

Documentation

  • Document the VM
  • Document the user-facing API
  • Document the overall architecture

General

  • Get this on NPM?