{"id":37194499,"url":"https://github.com/baris-inandi/bfgo","last_synced_at":"2026-01-14T22:36:57.710Z","repository":{"id":54466325,"uuid":"427649034","full_name":"baris-inandi/bfgo","owner":"baris-inandi","description":"A fast, optimizing, BF compiler, interpreter, and REPL. Also includes a BF formatter and minifier! Implemented in Go. Batteries included.","archived":false,"fork":false,"pushed_at":"2024-05-29T02:37:55.000Z","size":9391,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T18:21:30.898Z","etag":null,"topics":["bf","cli","compiler","esolang","go","golang","interpreter","repl"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baris-inandi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-13T11:41:10.000Z","updated_at":"2024-06-13T15:16:00.000Z","dependencies_parsed_at":"2024-06-21T17:00:11.502Z","dependency_job_id":"26ea33d9-51c9-489f-b437-d9cff93e939c","html_url":"https://github.com/baris-inandi/bfgo","commit_stats":null,"previous_names":["baris-inandi/brainfuck","baris-inandi/bfgo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/baris-inandi/bfgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baris-inandi%2Fbfgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baris-inandi%2Fbfgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baris-inandi%2Fbfgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baris-inandi%2Fbfgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baris-inandi","download_url":"https://codeload.github.com/baris-inandi/bfgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baris-inandi%2Fbfgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bf","cli","compiler","esolang","go","golang","interpreter","repl"],"created_at":"2026-01-14T22:36:57.088Z","updated_at":"2026-01-14T22:36:57.694Z","avatar_url":"https://github.com/baris-inandi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bfgo\n\nbfgo is an overengineered BF toolkit written in Go.\n\n## Features\n\nThe toolkit includes the following features:\n\n- Native Compiler\n- JVM Compiler\n- JavaScript Compiler\n- Interpreter\n- REPL\n- Formatter\n- Minifier\n\n### Compiler\n\nThe compiler can compile for three different targets:\n\n- Binary for native execution\n- JVM bytecode\n- JavaScript for running in the browser\n\n#### Native\n\n**Example:** `$ bfgo examples/hello.bf`  \nCreates a binary `hello`. Run with `./hello`.\n\n#### JVM Compiler\n\n**Example:** `$ bfgo -jvm examples/hello.bf`  \nGenerates a JVM classfile `Hello.class`. Run with `java Hello`.\n\n#### JavaScript Compiler\n\n**Example:** `$ bfgo -js examples/hello.bf`  \nGenerates a JavaScript file `hello.js` and an HTML file `hello.html`.  \nRun your favorite HTTP server and load `hello.html` in the browser.\nThe output will replace the document `\u003cbody\u003e`.\n\n### The Optimizer\n\nAll compile targets can be compiled with **the optimizer**. The optimizer options are:\n\n- `-F`: Fast\n  - Uses fast IR generation\n  - Results in fast compile times\n  - Causes Slow execution\n  - \u003e use `-o-compile` or `-F`\n- `-B`: Balanced\n  - Default behaviour\n  - Applies some optimizations\n  - Balance between -F and -O\n  - \u003e use `-o-balanced` or `-B`\n- `-O`: Optimized\n  - Uses the full optimizer\n    - Dead code elimination\n    - Canonicalization\n  - Smaller binary size\n    - Also performs binary stripping\n  - Causes Slow compile times\n  - Results in very fast execution\n  - \u003e use `-o-performance` or `-O`\n\n### Interpreter\n\nExecutes given BF file.\nThere is still room for improvement when it comes to performance. Feel free to submit a PR.\n\n\u003e use `-interpret`\n\n#### REPL\n\nThe REPL is a command line interface for the interpreter.\nIt can be used to execute BF interactively.\n\n\u003e use `-repl`\n\n### bffmt\n\nBF formatter bundled with `bfgo`.  \n\n\u003e Warning: bffmt currently omits all comments. Feel free to submit a PR for support for comments.  \n\u003e use `-fmt`\n\nExample formatted snippet from `examples/fibonacci.bf`:\n\n```plaintext\n  [\n    +++++\n    [\u003e++++++++\u003c-]\u003e .\n    \u003c++++++\n    [\u003e--------\u003c-]+\u003c\u003c\u003c\n  ]\n```\n\n#### Minifier\n\nbffmt can also minify BF code, leaving only valid characters, minimizing file size.\n\n## Cli Flags\n\n```plaintext\n--run, -r                  Immediately run binary after compilation (default: false)\n--output value, -o value   Specify output binary\n--compile-only, -C         Only compile, do not output a binary (default: false)\n--clang                    Use clang instead of default gcc (default: false)\n--jvm                      Compile to JVM bytecode (default: false)\n--js                       Compile to JavaScript (default: false)\n--o-compile, -F            Disable optimizations and use fast compiler: fast compile time, slow execution (default: false)\n--o-balanced, -B           Minimal optimizations for balanced compile time and performance, default behavior (default: false)\n--o-performance, -O        Enable optimizations: fast execution, slow compile time (default: false)\n--interpret                Interpret file instead of compiling (default: false)\n--repl                     Start a read-eval-print loop (default: false)\n--c-compiler-flags value   Pass arbitrary flags to the compiler (gcc, clang or javac)\n--c-tape-size value        Integer to specify length of BF tape (default: 30000)\n--c-tape-init value        Integer value used to initialize all elements in BF tape (default: 0)\n--c-cell-type value        Type used for BF tape in intermediate representation (default: \"int\")\n--d-dump-ir                Dump intermediate representation (default: false)\n--d-keep-temp              Do not remove temporary IR files (default: false)\n--d-print-ir-filepath      Dump temporary IR filepath, use -d-keep-temp to keep them from being deleted (default: false)\n--d-print-compile-command  Print C IR compiler command (default: false)\n--verbose, -v              Print verbose output (default: false)\n--debug, -d                Produce debug output, overrides -o (default: false)\n--time, -t                 Prints out execution time before exiting (default: false)\n--fmt                      Format code (omits comments) (default: false)\n--minify                   Minify code (default: false)\n--help, -h                 show help (default: false)\n```\n\n## Benchmark\n\nThe following is a benchmark of `examples/mandelbrot.bf`\n\n| Optimization Level | -F      | -B         | -O         |\n| ------------------ | ------- | ---------- | ---------- |\n| Native (arm64)     | 8 secs  | 580 millis | 370 millis |\n| Native (x64)       | 16 secs | 710 millis | 440 millis |\n| JVM                | 22 secs | 13 secs    | 13 secs    |\n| JavaScript         | 35 secs | 19 secs    | 5 secs     |\n\n\u003e Native arm64 using entry level M2 MacBook Air  \n\u003e Native x64 using Ryzen 5 3600  \n\u003e JavaScript using Google Chrome 106.0.5245.0 dev  \n\u003e JVM using latest OpenJDK 18 release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaris-inandi%2Fbfgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaris-inandi%2Fbfgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaris-inandi%2Fbfgo/lists"}