Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amdrel/mlbf
An optimizing Brainfuck interpreter / compiler written in C.
https://github.com/amdrel/mlbf
brainfuck brainfuck-interpreter compiler scripting-language stdin
Last synced: 8 days ago
JSON representation
An optimizing Brainfuck interpreter / compiler written in C.
- Host: GitHub
- URL: https://github.com/amdrel/mlbf
- Owner: Amdrel
- License: mit
- Created: 2017-04-19T06:32:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-09T23:07:37.000Z (over 6 years ago)
- Last Synced: 2024-05-18T21:45:25.678Z (6 months ago)
- Topics: brainfuck, brainfuck-interpreter, compiler, scripting-language, stdin
- Language: C
- Homepage:
- Size: 110 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# My Little Brainfuck
A simple brainfuck interpreter written in C. Brainfuck is fed through stdin and
output is written to stdout. If you ever wanted to use brainfuck in your
scripting environment this is the right tool for you.mlbf can also convert brainfuck to C, which can then be passed to a compiler
and turned into native code. Depending on the optimization level used,
compilation may take a while; however when used with programs like
mandlebrot.b, performance increases as much as 6x can be seen at runtime.## Why?
I plan on using this on a future project and it was a excellent excuse to get
comfortable with C.## Security
Contact me at [email protected] first for bugs that you believe are critical
security issues (buffer over-reads and the like) before reporting them in the
issue trackers.## Changelog
### Jul 02, 2018 (1.0.0)
* Command-line arguments are now supported.
* Added dump flag to output brainfuck IR to stdout.
* Added output flag used to generate a C program from brainfuck IR.### Jul 01, 2018
* Added brainfuck bytecode to C transpiler (4-6x performance increase on
average). This feature isn't compiled in at the moment as mlbf isn't set up
to accept command-line flags.
* Added copy loop optimization.### Jun 30, 2018
* Added multiplication loop optimization.
* Added clear loop optimization.
* Added instruction contraction optimization.### Jun 20, 2018
* Released a new bytecode compiler and interpreter for faster execution.
### May 29, 2018
* Added automated testing script.
* Migrated from GNU Make to Meson.### May 20, 2018
* Implemented the ',' instruction.
### Apr 18, 2017
* First limited working version finished, albeit very slow.
## License
Copyright (c) 2017 Walter Kuppens
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.