{"id":24333795,"url":"https://github.com/gargakshit/bfcc","last_synced_at":"2025-07-31T04:37:13.714Z","repository":{"id":138219966,"uuid":"586000289","full_name":"gargakshit/bfcc","owner":"gargakshit","description":"Brainf*ck to LLVM compiler written in Go","archived":false,"fork":false,"pushed_at":"2023-01-06T17:07:25.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T10:58:22.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gargakshit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-01-06T17:07:11.000Z","updated_at":"2023-03-04T10:26:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"fef41c10-c92d-4ebf-8520-dc2c63f04262","html_url":"https://github.com/gargakshit/bfcc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gargakshit%2Fbfcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gargakshit%2Fbfcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gargakshit%2Fbfcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gargakshit%2Fbfcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gargakshit","download_url":"https://codeload.github.com/gargakshit/bfcc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gargakshit%2Fbfcc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172971,"owners_count":22816559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-01-18T03:46:38.197Z","updated_at":"2025-06-11T00:06:54.671Z","avatar_url":"https://github.com/gargakshit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bfcc\r\n\r\n[Brainf*ck](https://en.wikipedia.org/wiki/Brainfuck) compiler and interpreter\r\nwritten in Go.\r\n\r\n## Interpreter\r\n\r\nThe interpreter contained in the `cmd/bfi` directory is a basic brainf*ck\r\ninterpreter that does no optimizations.\r\n\r\n## Compiler\r\n\r\nThe compiler contained in `cmd/bfcc` is a LLVM-based compiler for brainf*ck.\r\nCurrently, it emits [LLVM IR](https://llvm.org/docs/LangRef.html) on the\r\n`stdout` which may be piped to clang for compilation.\r\n\r\nThe compiled program is expected to be linked with `libc` for `getch`, `putch`\r\nand `memset`.\r\n\r\n### Compiling a program\r\n\r\n```shell\r\ngo run ./cmd/bfcc \u003cpath-to-brainf*ck-program\u003e | clang -x ir -o \u003cpath-to-output\u003e -\r\n```\r\n\r\n## Performance\r\n\r\nAll these tests are run on a R7-5700U running Windows 11 with the following\r\nflags for `clang`: `-flto -O3 -fuse-ld=lld-link`\r\n\r\n| Program            | `bfi`                   | `bfcc`  |\r\n|--------------------|-------------------------|---------|\r\n| Tower of hanoi     | 14.895s                 | 0.029s  |\r\n| Mandelbrot         | 33.511s                 | 0.613s  |\r\n| Mandelbrot Extreme | did not complete in 30m | 76.102s |\r\n\r\nThe compiled version here is anywhere from **50-500 times** faster.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgargakshit%2Fbfcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgargakshit%2Fbfcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgargakshit%2Fbfcc/lists"}