{"id":29682112,"url":"https://github.com/stepainpy/brainfuck","last_synced_at":"2025-10-18T18:13:44.519Z","repository":{"id":305557877,"uuid":"1018618433","full_name":"Stepainpy/brainfuck","owner":"Stepainpy","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-20T18:58:35.000Z","size":249,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T20:30:05.300Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stepainpy.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,"zenodo":null}},"created_at":"2025-07-12T16:48:45.000Z","updated_at":"2025-07-20T18:58:39.000Z","dependencies_parsed_at":"2025-07-20T20:41:56.433Z","dependency_job_id":null,"html_url":"https://github.com/Stepainpy/brainfuck","commit_stats":null,"previous_names":["stepainpy/brainfuck"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Stepainpy/brainfuck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2Fbrainfuck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2Fbrainfuck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2Fbrainfuck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2Fbrainfuck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stepainpy","download_url":"https://codeload.github.com/Stepainpy/brainfuck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stepainpy%2Fbrainfuck/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266604009,"owners_count":23954725,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-07-23T02:08:06.403Z","updated_at":"2025-10-18T18:13:44.512Z","avatar_url":"https://github.com/Stepainpy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brainfuck virtual machine\n\n## Overview\n\nLittle Brainfuck virtual machine. Brainfuck source code convert to optimized byte-code for machine.\nSupport interruption via breakpoints (see [bf source](./bf.c)).\n\n## Usage\n\n### As standalone code\n\n``` console\n$ bf \u003ccode.bf\u003e [-A] [\u003cinputfile\u003e]\n```\n\n### As external part\n\n1. compile library.\n2. copy `bfconf.h`, `brainfuck.h` and library file to your project.\n3. use API functions `bfa_compile`, `bfa_execute` and etc.\n\nMinimal code example:\n```c\n#include \u003cstdio.h\u003e\n#include \u003cstring.h\u003e\n#include \"brainfuck.h\"\n\nconst char* source = // print \"brainfuck\"\n\"\u003e++++[\u003e++++++\u003c-]\u003e-[[\u003c+++++\u003e\u003e+\u003c-]\u003e-]\u003c\u003c[\u003c]\u003e\u003e\u003e\u003e-\"\n\"-.\u003c\u003c\u003c-.\u003e\u003e\u003e-.\u003c.\u003c.\u003e---.\u003c\u003c+++.\u003e\u003e\u003e++.\u003c\u003c---.[\u003e]\u003c\u003c.\";\n\nstatic void read(void* file, bft_cell* cell) {\n    int ch = fgetc(file);\n    *cell = ch != EOF ? ch : 0;\n}\n\nstatic void write(void* file, bft_cell cell) {\n    fputc(cell, file);\n}\n\nint main(void) {\n    bft_error rc = BFE_OK;\n    bft_program program = {0};\n    bft_env env = { stdin, stdout, read, write };\n\n    rc = bfa_compile(\u0026program, source, strlen(source));\n    if (rc) { // error handling\n        fprintf(stderr, \"bfa_compile(): %s\\n\", bfa_strerror(rc));\n        return 1;\n    }\n    rc = bfa_execute(\u0026program, \u0026env, NULL); // no breakpoints\n    if (rc) { // error handling\n        bfa_destroy(\u0026program);\n        fprintf(stderr, \"bfa_execute(): %s\\n\", bfa_strerror(rc));\n        return 1;\n    }\n    bfa_destroy(\u0026program);\n\n    return 0;\n}\n```\n\n## Prefix cheatsheet\n\n| Prefix | Full name   |\n| :----: | :---------- |\n|  `t`   | type        |\n|  `a`   | API         |\n|  `d`   | debug       |\n|  `s`   | stack       |\n|  `c`   | code        |\n|  `p`   | parse       |\n|  `u`   | utility     |\n|  `i`   | instruction |\n|  `I`   | instruction |\n|  `E`   | error       |\n|  `M`   | mask        |\n|  `C`   | constant    |\n|  `K`   | kind        |\n|  `D`   | define      |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepainpy%2Fbrainfuck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepainpy%2Fbrainfuck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepainpy%2Fbrainfuck/lists"}