{"id":31574761,"url":"https://github.com/xplshn/cbc","last_synced_at":"2025-10-05T16:58:52.204Z","repository":{"id":305247915,"uuid":"1022361235","full_name":"xplshn/cbc","owner":"xplshn","description":"C B Compiler, a working B compiler that is fully compliant with B, with nice warnings and errors, configurable via standard flags like -W/-Wno, and -F and -Fno to turn on/off warns/features. -std=B/-std=Bx for some extensions. Compatible with tsoding/b","archived":false,"fork":false,"pushed_at":"2025-08-13T02:58:10.000Z","size":344,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-13T04:27:20.690Z","etag":null,"topics":["b","blang","c","c11","compiler","compiler-design","language","qbe","suckless","unix"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xplshn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-18T23:21:00.000Z","updated_at":"2025-08-13T02:58:14.000Z","dependencies_parsed_at":"2025-07-19T04:56:52.320Z","dependency_job_id":"abb8b3c9-6294-4776-a970-064f6ada8cc4","html_url":"https://github.com/xplshn/cbc","commit_stats":null,"previous_names":["xplshn/cbc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xplshn/cbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplshn%2Fcbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplshn%2Fcbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplshn%2Fcbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplshn%2Fcbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xplshn","download_url":"https://codeload.github.com/xplshn/cbc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xplshn%2Fcbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278486275,"owners_count":25994941,"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-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["b","blang","c","c11","compiler","compiler-design","language","qbe","suckless","unix"],"created_at":"2025-10-05T16:58:49.964Z","updated_at":"2025-10-05T16:58:52.195Z","avatar_url":"https://github.com/xplshn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e __GBC__ - Go B Compiler - https://github.com/xplshn/gbc\n\u003e\n\u003e A much more capable and self-contained B compiler, written using modernc.org/libqbe\n---\n\n# (cbc) | The C B Compiler\n\nThis compiler is a project aiming to make a valid B compiler, with _optional_ extensions for C interoperability, and a modules system like Go's\n\n```\n]~/Documents/TrulyMine/cbc@ ./cbc \n\nCopyright (c) 2025: xplshn and contributors\nFor more details refer to \u003chttps://github.com/xplshn/cbc\u003e\n\n  Synopsis\n    ./cbc [options] \u003cinput.b\u003e ...\n\n  Description\n    A compiler for the B programming language and its extensions.\n\n  Options\n    -o \u003cfile\u003e              Place the output into \u003cfile\u003e.\n    -h, --help             Display this information.\n    -std=\u003cstd\u003e             Specify language standard (B, Bx). Default: Bx\n    -pedantic              Issue all warnings demanded by the current B std.\n\n  Warning Flags\n    -Wall                  Enable most warnings.\n    -Wno-all               Disable all warnings.\n    -W\u003cwarning\u003e            Enable a specific warning.\n    -Wno-\u003cwarning\u003e         Disable a specific warning.\n    Available warnings:\n      c-escapes              Using C-style '\\' escapes instead of B's '*'                                [x]\n      b-escapes              Using historical B-style '*' escapes instead of C's '\\'                     [x]\n      b-ops                  Using historical B assignment operators like '=+'                           [x]\n      c-ops                  Using C-style assignment operators like '+=' in -std=B mode                 [x]\n      unrecognized-escape    Using unrecognized escape sequences                                         [x]\n      truncated-char         Character escape value is too large for a byte and has been truncated       [x]\n      long-char-const        Multi-character constant is too long for a word                             [x]\n      c-comments             Using non-standard C-style '//' comments                                    [-]\n      overflow               Integer constant is out of range for its type                               [x]\n      pedantic               Issues that violate the current strict -std=                                [-]\n      unreachable-code       Unreachable code                                                            [x]\n      extra                  Extra warnings (e.g., poor choices, unrecognized flags)                     [x]\n\n  Feature Flags\n    -F\u003cfeature\u003e            Enable a specific feature.\n    -Fno-\u003cfeature\u003e         Disable a specific feature.\n    Available features:\n      extrn                  Allow the 'extrn' keyword                                                   [x]\n      asm                    Allow the '__asm__' keyword and blocks                                      [x]\n      b-escapes              Recognize B-style '*' character escapes                                     [x]\n      c-escapes              Recognize C-style '\\' character escapes                                     [x]\n      b-compound-assign      Recognize B-style assignment operators like '=+'                            [x]\n\n]~/Documents/TrulyMine/cbc@ \n```\n\nThe project is currently in its infancy, and the long-term goals are very ambitious. This is the current roadmap:\n\n\u003e ##### ROADMAP\n\u003e\n\u003e ###### (i) Tests\n\u003e * ~~Make a script that takes the tests from [tsoding/b](https://github.com/tsoding/b), and filters the tests.json to only include the IR tests~~\n\u003e * Make a Go program that runs each test, displays the passing/failing ones\n\u003e\n\u003e ###### (ii) Compatibility with [tsoding/b](https://github.com/tsoding/b)\n\u003e 1. ~~Support the \"extrn\" keyword, as well as inline assembly~~\n\u003e 2. ~~Use the same warning \u0026 error messages [tsoding/b](https://github.com/tsoding/b)~~ / our warnings n errors are much better\n\u003e 3. ~~Be able to pass the IR tests of [tsoding/b](https://github.com/tsoding/b)~~\n\u003e\n\u003e ###### (iii) Packages / Modules inspired by Go\n\u003e * ¿.. Namespaces based on .mod file ..?\n\u003e * Implement a way to import/export symbols from different .B files, in different namespaces\n\u003e\n\n### Contributions are hyper-mega welcome\n\n##### References\n- https://research.swtch.com/b-lang\n- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/kbman.html\n- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/bref.html\n- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/btut.html\n- https://github.com/Spydr06/BCause\n- https://github.com/kparc/bcc\n###### Not B-related, but I did find these helpful for learning how to write the compiler:\n- [comp-bib](https://c9x.me/compile/bib/): \"Resources for Amateur Compiler Writers\"\n- [qcc](https://c9x.me/qcc): dead-simple C compiler\n- [cproc](https://github.com/michaelforney/cproc): QBE-backed compiler written in C99, with support for some C23 \u0026 GNU C extensions\n\n###### Cool stuff used by this project:\n- [QBE](https://c9x.me/compile/): The QBE compiler backend\n\n---\n\n###### TODO: ...I should write a Limbo compiler when I finish this project...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxplshn%2Fcbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxplshn%2Fcbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxplshn%2Fcbc/lists"}