{"id":17680779,"url":"https://github.com/kcreate/brainfuck-compiler","last_synced_at":"2025-05-12T23:11:02.936Z","repository":{"id":72282577,"uuid":"91884065","full_name":"KCreate/brainfuck-compiler","owner":"KCreate","description":"Brainfuck to StackVM compiler written in C","archived":false,"fork":false,"pushed_at":"2017-07-23T06:58:36.000Z","size":27,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-09T18:56:55.621Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/KCreate/c-stackvm","language":"C","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/KCreate.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":"2017-05-20T11:14:35.000Z","updated_at":"2023-03-10T09:59:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"71611e6a-3881-40f2-9f45-ea2695705a75","html_url":"https://github.com/KCreate/brainfuck-compiler","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/KCreate%2Fbrainfuck-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fbrainfuck-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fbrainfuck-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2Fbrainfuck-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KCreate","download_url":"https://codeload.github.com/KCreate/brainfuck-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837452,"owners_count":21971984,"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":"2024-10-24T09:08:48.517Z","updated_at":"2025-05-12T23:11:02.910Z","avatar_url":"https://github.com/KCreate.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brainfuck to StackVM compiler\n\nThis repository is the home of a small compiler written in C. It compiles codes written in the\n[Brainfuck Language](https://en.wikipedia.org/wiki/Brainfuck) to assembly code for my own virtual machine.\n\n# Installation\n\nYou will need my [StackVM](https://github.com/KCreate/stackvm) to be able to assemble and execute the\nresulting assembly file. Take look at the installation instructions over there.\n\n1. `git clone https://github.com/KCreate/brainfuck-compiler`\n2. `make`\n3. `bin/bfc input.bf \u003e myprog.asm`\n4. `stackvm build myprog.asm -s -o myprog.bc`\n5. `stackvm run myprog.bc`\n\n# Features\n\n| Command | Meaning                                                                         | Status |\n|:-------:|---------------------------------------------------------------------------------|:------:|\n| `\u003e`     | Increment data pointer                                                          | ✓      |\n| `\u003c`     | Decrement data pointer                                                          | ✓      |\n| `+`     | Increment the value in the current cell                                         | ✓      |\n| `-`     | Decrement the value in the current cell                                         | ✓      |\n| `.`     | Output the byte at the data pointer                                             | ✓      |\n| `,`     | Read a byte of input and store it in the byte at the data pointer               | 𐄂      |\n| `[`     | Jump to the matching `]` command if the byte at the data pointer is `0`         | ✓      |\n| `]`     | If the current byte is nonzero, jump back to the command after the matching `[` | ✓      |\n\n# Todos\n\n- [ ] Simple peep-hole optimizations\n- [ ] Better error handling\n- [ ] Location information in the AST\n- [ ] `,` command (StackVM needs to be patched for this to work)\n\n# Credits\n\n- [Leonard Schütz @KCreate](https://github.com/KCreate)\n\n# Additional resources\n\n- [Brainfuck on Wikipedia](https://en.wikipedia.org/wiki/Brainfuck)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcreate%2Fbrainfuck-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcreate%2Fbrainfuck-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcreate%2Fbrainfuck-compiler/lists"}