{"id":15049332,"url":"https://github.com/spydr06/bcause","last_synced_at":"2025-04-10T02:07:02.503Z","repository":{"id":45391352,"uuid":"496732665","full_name":"Spydr06/BCause","owner":"Spydr06","description":"BCause (pronounced \"because\") is a compiler for the old B programming language (1969) for modern systems.","archived":false,"fork":false,"pushed_at":"2025-04-08T22:00:21.000Z","size":60,"stargazers_count":59,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-08T22:31:21.052Z","etag":null,"topics":["assembly","b","bcause","bell-labs","c","c99","compiler","hacktoberfest","hacktoberfest2023","language","libb","proglangs-discord","programming-language","single-pass"],"latest_commit_sha":null,"homepage":"","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/Spydr06.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}},"created_at":"2022-05-26T18:35:32.000Z","updated_at":"2025-04-08T22:00:25.000Z","dependencies_parsed_at":"2025-04-08T22:37:23.037Z","dependency_job_id":null,"html_url":"https://github.com/Spydr06/BCause","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/Spydr06%2FBCause","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spydr06%2FBCause/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spydr06%2FBCause/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spydr06%2FBCause/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spydr06","download_url":"https://codeload.github.com/Spydr06/BCause/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142942,"owners_count":21054671,"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":["assembly","b","bcause","bell-labs","c","c99","compiler","hacktoberfest","hacktoberfest2023","language","libb","proglangs-discord","programming-language","single-pass"],"created_at":"2024-09-24T21:19:49.168Z","updated_at":"2025-04-10T02:07:02.495Z","avatar_url":"https://github.com/Spydr06.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BCause - B compiler for modern systems\n\n**BCause** is a compiler for the **B** programming language, developed by *Ken Thompson* and *Dennis Ritchie* at *Bell Labs* in *1969*, later getting replaced by **C**. BCause is written in C99 and relies on a minimal set of dependencies, namely `libc` and the GNU binutils.\n\nThis repository also includes a `libb.a` implementation, B's standard library. It requires zero dependencies, not even libc.\n\nBCause is implemented as a small single-pass compiler in ~2500 lines of pure C99 code. Therefore, it features small compile times with a very low memory footprint.\n\n### Current Status\n\n- [x] global variables\n- [x] functions\n- [x] `auto` \u0026 `extrn` variables\n- [x] control flow statements\n- [x] expressions\n- [x] `libb.a` standard library\n- [ ] optimization\n- [ ] nicer error messages\n\n### Compatibility\n\nDue to BCause's simplicity, only **`gnu-linux-x86_64`**-systems are supported.\n\n- If your system can run *GNU-`make`*, *GNU-`ld`* and *GNU-`as`*, BCause itself should be able to work.\n- Because of the reliance on system-calls `libb.a` has to be implemented for each system separately.\n\n\u003e **Note**\n\u003e Feel free to submit pull requests to provide more OS support and fix bugs.\n\n### Installation\n\nTo install BCause, first clone this repository:\n```console\n$ git clone https://github.com/spydr06/bcause.git\n$ cd ./bcause\n```\nThen, build the project:\n```console\n$ make\n```\nTo install BCause on your computer globally, use:\n```console\n# make install\n```\n\u003e **Warning**\n\u003e this requires root privileges and modifies system files\n\n### Usage\n\nTo compile a B source file (`.b`), use:\n```console\n$ bcause \u003cyour file\u003e\n```\n\nTo get help, type:\n```console\n$ bcause --help\n```\n\n### Testing\n\nThe `tests/` directory contains numerous compiler tests. Please update these tests when adding new features. Tests are based on googletest and require `cmake` to be run:\n\n```console\n$ make test\n```\n\n### Licensing\nBCause is licensed under the MIT License. See `LICENSE` in this repository for further information.\n\n### References\n\n- [Bell Labs User's Reference to B](https://www.bell-labs.com/usr/dmr/www/kbman.pdf) by Ken Thompson (Jan. 7, 1972)\n\n- Wikipedia entry: [B (programming language)](https://en.wikipedia.org/wiki/B_(programming_language))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspydr06%2Fbcause","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspydr06%2Fbcause","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspydr06%2Fbcause/lists"}