--- id: bfi version: "1.1.1" license: MIT license_treatment: permissive maintenance: aging --- # bfi — A fast optimizing Brainfuck interpreter in pure python License: permissive · Maintenance: aging · Downloads: 338.5K/mo ## What it is and what it does bfi is a pure-Python interpreter for Brainfuck, an esoteric programming language. It works by first compiling Brainfuck source code into an intermediate bytecode form that collapses common instruction sequences—such as runs of cell pointer movements—into single optimized operations. This compilation step allows bfi to execute Brainfuck programs significantly faster than naive interpreters that process each source character individually. The package supports both Python 2 and Python 3, has no external runtime dependencies, and can be used either from the command line (via the `bfi` command) or imported as a module in your own code. It includes configurable tape size (default 30,000 cells) and wrapping overflow/underflow behavior. The package ships with example Brainfuck programs demonstrating various algorithms and games. Use it for: - Run Brainfuck programs from the command line without installing a separate interpreter or compiler - Execute Brainfuck code programmatically from Python, capturing output or providing custom input - Learn or teach esoteric language design and compilation techniques through a working pure-Python example - Benchmark or compare Brainfuck interpreter performance across implementations ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pure-Python interpreter for Brainfuck that compiles source code into an optimized intermediate form for faster execution than direct interpretation. Yes, if you need to run or study Brainfuck code. The package is lightweight, dependency-free, and genuinely faster than comparable pure-Python alternatives. However, maintenance is aging (last release 279 days ago), so treat it as stable but not actively developed. Not relevant for production systems or non-Brainfuck use cases. ## Install pip install bfi uv add bfi poetry add bfi ## Installing bfi Before you install: Low friction install with no runtime dependencies. Maintenance is aging—last release was 279 days ago, though the repository remains active and the package has been stable since its first release in 2017. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects. Quickstart: pip install bfi import bfi with open('hello_world.b', 'r') as fh: code = fh.read() output = bfi.interpret(code, stdin='', buffer_stdout=True) print(output) Verify before relying: - Whether the package is actively maintained beyond bug fixes, or if development has effectively stalled - Performance characteristics on modern Python versions beyond the CPython 2.7.14 benchmark mentioned in the documentation ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 338.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags brainfuck interpreter, esoteric language runner, brainfuck compiler, pure python interpreter, brainfuck optimization, brainfuck execution engine, esoteric-languages, interpreter, compiler [View on SkillFed](https://skillfed.io/packages/bfi) · [View on PyPI](https://pypi.org/project/bfi/)