https://github.com/fraya/dylan-brainfuck
Brainfuck interpreter in Opendylan
https://github.com/fraya/dylan-brainfuck
brainfuck brainfuck-interpreter
Last synced: 3 months ago
JSON representation
Brainfuck interpreter in Opendylan
- Host: GitHub
- URL: https://github.com/fraya/dylan-brainfuck
- Owner: fraya
- License: gpl-3.0
- Created: 2023-05-07T14:56:00.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-19T12:28:51.000Z (about 1 year ago)
- Last Synced: 2025-05-19T12:38:59.746Z (about 1 year ago)
- Topics: brainfuck, brainfuck-interpreter
- Language: Dylan
- Homepage: https://fraya.github.io/dylan-brainfuck/
- Size: 196 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dylan Brainfuck
[](https://github.com/fraya/dylan-brainfuck/actions/workflows/build-and-test.yml)
Brainfuck interpreter written in [Opendylan](https://opendylan.org/)
programming language.
This is an exploration of Opendylan features (mainly multimethods) and
is not trying to be "as fast as possible".
## Installation
TODO
## Execution
brainfuck-app
where:
- _program_ is a brainfuck program
- _optimization-level_ is a number between 0 and 4 (default `4`):
- `0`: No optimization
- `1`: Remove comments
- `2`: Group similar instructions (e.g. `++` becomes `+2`)
- `3`: Replace pattern `[-]` with a reset to zero
- `4`: Precalculate jumps (e.g. `[+>]` becomes `[3+>]0`
### Examples
In the directory `examples` there are several brainfuck programs.
## TODO
### General
- [X] Load a program from a ``
- [X] Load a program from a file (``)
### Instructions
- [X] increment-data
- [X] decrement-data
- [X] increment-pointer
- [X] decrement-pointer
- [ ] input
- [X] output
- [X] jump-forward
- [X] jump-backward
### Optimizations
- [X] Remove comments
- [X] Group instructions
- [X] Replace `[-]` pattern for a reset to zero instruction.
- [X] Precomputed jumps
## Project organization
```bash
├── documentation # documentation in .rst format
├── dylan-package.json # project description
├── examples # program examples in .bf language
└── src # source code
├── app # application
├── lib # library
└── tests # tests
```