{"id":25171755,"url":"https://github.com/basemax/brainfuckcompilerc","last_synced_at":"2026-02-09T09:35:31.719Z","repository":{"id":60614633,"uuid":"543296989","full_name":"BaseMax/BrainfuckCompilerC","owner":"BaseMax","description":"A C compiler to read and generate C-code from Brainfuck programs (Designed in pure C in the simplest way)","archived":false,"fork":false,"pushed_at":"2022-09-29T20:56:19.000Z","size":22,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T21:13:02.068Z","etag":null,"topics":["bf","bf-compiler","bf-language","brainfuck","brainfuck-compiler","brainfuck-language","brainfuck-translator","brainfuck-transpiler","c","c-compiler","compiler-design","compiler-frontend","compilers","transpiler","transpiler-bf","transpilers"],"latest_commit_sha":null,"homepage":"","language":"C","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/BaseMax.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}},"created_at":"2022-09-29T19:56:36.000Z","updated_at":"2022-10-18T19:49:41.000Z","dependencies_parsed_at":"2022-10-02T04:50:25.502Z","dependency_job_id":null,"html_url":"https://github.com/BaseMax/BrainfuckCompilerC","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/BaseMax%2FBrainfuckCompilerC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBrainfuckCompilerC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBrainfuckCompilerC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBrainfuckCompilerC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/BrainfuckCompilerC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577022,"owners_count":21770721,"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":["bf","bf-compiler","bf-language","brainfuck","brainfuck-compiler","brainfuck-language","brainfuck-translator","brainfuck-transpiler","c","c-compiler","compiler-design","compiler-frontend","compilers","transpiler","transpiler-bf","transpilers"],"created_at":"2025-02-09T09:21:58.697Z","updated_at":"2026-02-09T09:35:27.436Z","avatar_url":"https://github.com/BaseMax.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brainfuck Compiler in C\r\n\r\nA C compiler to read and generate C-code from Brainfuck programs (Designed in pure C in the simplest way)\r\n\r\n## Using\r\n\r\n```\r\n$ gcc brainfuck.c -o bf\r\n$ ./bf\r\n```\r\n\r\n### Brainfuck Compiler\r\n\r\n- **`./bf [file.bf]`**\r\n\r\n- **`./bf`** After running the program, the program will wait for you to type your BF program, finally you can easily type `x` character to stop and generate C-code.\r\n\r\n## BF Programs\r\n\r\n### Fibonacci\r\n\r\n**./bf fibonacci.bf**\r\n\r\n```bf\r\n+++++++++++\u003e+\u003e\u003e\u003e\u003e++++++++++++++++++++++++++++++++++++++\r\n++++++\u003e++++++++++++++++++++++++++++++++\u003c\u003c\u003c\u003c\u003c\u003c[\u003e[\u003e\u003e\u003e\u003e\u003e\u003e+\r\n\u003e+\u003c\u003c\u003c\u003c\u003c\u003c\u003c-]\u003e\u003e\u003e\u003e\u003e\u003e\u003e[\u003c\u003c\u003c\u003c\u003c\u003c\u003c+\u003e\u003e\u003e\u003e\u003e\u003e\u003e-]\u003c[\u003e++++++++++[-\u003c-[\u003e\r\n\u003e+\u003e+\u003c\u003c\u003c-]\u003e\u003e\u003e[\u003c\u003c\u003c+\u003e\u003e\u003e-]+\u003c[\u003e[-]\u003c[-]]\u003e[\u003c\u003c[\u003e\u003e\u003e+\u003c\u003c\u003c-]\u003e\u003e[-]]\u003c\r\n\u003c]\u003e\u003e\u003e[\u003e\u003e+\u003e+\u003c\u003c\u003c-]\u003e\u003e\u003e[\u003c\u003c\u003c+\u003e\u003e\u003e-]+\u003c[\u003e[-]\u003c[-]]\u003e[\u003c\u003c+\u003e\u003e[-]]\u003c\u003c\u003c\r\n\u003c\u003c\u003c\u003c]\u003e\u003e\u003e\u003e\u003e[++++++++++++++++++++++++++++++++++++++++++++\r\n++++.[-]]++++++++++\u003c[-\u003e-\u003c]\u003e++++++++++++++++++++++++++++\r\n++++++++++++++++++++.[-]\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c\u003c[\u003e\u003e\u003e+\u003e+\u003c\u003c\u003c\u003c-]\u003e\u003e\u003e\u003e[\u003c\r\n\u003c\u003c\u003c+\u003e\u003e\u003e\u003e-]\u003c-[\u003e\u003e.\u003e.\u003c\u003c\u003c[-]]\u003c\u003c[\u003e\u003e+\u003e+\u003c\u003c\u003c-]\u003e\u003e\u003e[\u003c\u003c\u003c+\u003e\u003e\u003e-]\u003c\u003c[\u003c\r\n+\u003e-]\u003e[\u003c+\u003e-]\u003c\u003c\u003c-]\r\n```\r\n\r\n### Hello World\r\n\r\n**./bf hello-world.bf**\r\n\r\n```bf\r\n\u003e++++++++[\u003c+++++++++\u003e-]\u003c.\r\n\u003e++++[\u003c+++++++\u003e-]\u003c+.\r\n+++++++..\r\n+++.\r\n\u003e\u003e++++++[\u003c+++++++\u003e-]\u003c++.\r\n------------.\r\n\u003e++++++[\u003c+++++++++\u003e-]\u003c+.\r\n\u003c.\r\n+++.\r\n------.\r\n--------.\r\n\u003e\u003e\u003e++++[\u003c++++++++\u003e-]\u003c+.\r\n```\r\n\r\n## Tokens\r\n\r\n| Token | Description |\r\n| ----- | --------------------------- |\r\n| \u003e\t| Move the pointer to the right |\r\n| \u003c\t| Move the pointer to the left |\r\n| +\t| Increment the memory cell at the pointer |\r\n| -\t| Decrement the memory cell at the pointer |\r\n| .\t| Output the character signified by the cell at the pointer |\r\n| ,\t| Input a character and store it in the cell at the pointer |\r\n| [\t| Jump past the matching ] if the cell at the pointer is 0 |\r\n| ]\t| Jump back to the matching [ if the cell at the pointer is nonzero |\r\n| any | All characters other than \u003e\u003c+-.,[] should be considered comments and ignored |\r\n\r\n## Brainfuck\r\n\r\nBrainfuck is an esoteric programming language created in 1993 by Urban Müller.\r\n\r\nNotable for its extreme minimalism, the language consists of only eight simple commands, a data pointer and an instruction pointer. While it is fully Turing complete, it is not intended for practical use, but to challenge and amuse programmers. Brainfuck requires one to break commands into microscopic steps.\r\n\r\nThe language's name is a reference to the slang term brainfuck, which refers to things so complicated or unusual that they exceed the limits of one's understanding as it was not meant or made for designing actual software but to challenge the boundaries of computer programming.\r\n\r\nRead more: https://en.wikipedia.org/wiki/Brainfuck\r\n\r\n### Online runner\r\n\r\n- https://www.dcode.fr/brainfuck-language\r\n\r\n### ASCII Table\r\n\r\nhttps://en.wikipedia.org/wiki/ASCII\r\n\r\nYou are welcome to add more features and send Pull request.\r\n\r\n© Copyright 2022, Max Base\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fbrainfuckcompilerc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fbrainfuckcompilerc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fbrainfuckcompilerc/lists"}