{"id":20177853,"url":"https://github.com/tfc/cpp_template_meta_brainfuck_interpreter","last_synced_at":"2025-10-30T07:49:10.601Z","repository":{"id":8288302,"uuid":"57872410","full_name":"tfc/cpp_template_meta_brainfuck_interpreter","owner":"tfc","description":"A Brainfuck Interpreter, which is completely implemented from scratch as a C++ Template Meta Program","archived":false,"fork":false,"pushed_at":"2022-03-22T12:38:42.000Z","size":20,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:38:52.011Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tfc.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}},"created_at":"2016-05-02T07:28:58.000Z","updated_at":"2023-03-24T03:16:05.000Z","dependencies_parsed_at":"2022-08-07T01:15:22.515Z","dependency_job_id":null,"html_url":"https://github.com/tfc/cpp_template_meta_brainfuck_interpreter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tfc/cpp_template_meta_brainfuck_interpreter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fcpp_template_meta_brainfuck_interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fcpp_template_meta_brainfuck_interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fcpp_template_meta_brainfuck_interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fcpp_template_meta_brainfuck_interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfc","download_url":"https://codeload.github.com/tfc/cpp_template_meta_brainfuck_interpreter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fcpp_template_meta_brainfuck_interpreter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263410776,"owners_count":23462299,"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-11-14T02:17:47.052Z","updated_at":"2025-10-30T07:49:05.555Z","avatar_url":"https://github.com/tfc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A C++ Template Meta Brainfuck Interpreter\n\nFor exercise reasons, i implemented this Brainfuck Interpreter on a long train ride.\nIt works completely at compile time, as it is implemented in a purely functional way, expressed in C++ Template Language.\n\nThe program and user input is provided via type lists, and the output is a type list again.\nThe output string, as well as the Brainfuck Machine state can be printed as a compiler error message, or on the terminal when launching the program after compilation.\n\n## Usage\n\nProgram and user input are provided via preprocessor macros on the command line:\n``` bash\nJacek.Galowicz ~/src/tmp_brainfuck $ g++ -o main main.cpp -std=c++14 -DINPUT_STR=\\\"z\\\" -DPROGRAM_STR=\\\",[.-]\\\"\nJacek.Galowicz ~/src/tmp_brainfuck $ ./main\nzyxwvutsrqponmlkjihgfedcba`_^]\\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?\u003e=\u003c;:9876543210/.-,+*)('\u0026%$#\"!\n```\n\nThe brainfuck program output can also be printed at compile time, by producing an error message with the helper type ```debug_t```:\n\n\"*Hello World*\" example, printed at compile time:\n``` bash\nJacek.Galowicz ~/src/tmp_brainfuck $ g++ -o main main.cpp -std=c++14 -DPROGRAM_STR='\"++++++++++[\u003e+++++++\u003e++++++++++\u003e+++\u003e+\u003c\u003c\u003c\u003c-]\u003e++.\u003e+.+++++++..+++.\u003e++.\u003c\u003c+++++++++++++++.\u003e.+++.------.--------.\u003e+.\u003e.+++.\"'\nmain.cpp:31:51: error: implicit instantiation of undefined template \n'debug_t\u003cchar_tl\u003c'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\\n', '\\x0D'\u003e \u003e'\n    debug_t\u003ctypename tl_to_varlist\u003coutput\u003e::list\u003e t;\n                                                  ^\nmain.cpp:6:29: note: template is declared here\ntemplate \u003ctypename T\u003e class debug_t;\n                            ^\n1 error generated.\nMakefile:3: recipe for target 'default' failed\nmake: *** [default] Error 1\n``` \n\nThe \"Hello World\" example, printed at runtime:\n\n``` bash\nJacek.Galowicz ~/src/tmp_brainfuck $ g++ -o main main.cpp -std=c++14 -DPROGRAM_STR='\"++++++++++[\u003e+++++++\u003e++++++++++\u003e+++\u003e+\u003c\u003c\u003c\u003c-]\u003e++.\u003e+.+++++++..+++.\u003e++.\u003c\u003c+++++++++++++++.\u003e.+++.------.--------.\u003e+.\u003e.+++.\"'\nJacek.Galowicz ~/src/tmp_brainfuck $ ./main\nHello World!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfc%2Fcpp_template_meta_brainfuck_interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfc%2Fcpp_template_meta_brainfuck_interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfc%2Fcpp_template_meta_brainfuck_interpreter/lists"}