{"id":24370531,"url":"https://github.com/aap/b","last_synced_at":"2025-04-10T17:53:48.687Z","repository":{"id":44940305,"uuid":"291051439","full_name":"aap/b","owner":"aap","description":"B compiler","archived":false,"fork":false,"pushed_at":"2023-07-12T17:37:24.000Z","size":113,"stargazers_count":62,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T15:42:06.095Z","etag":null,"topics":["b","compiler"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/aap.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":"2020-08-28T13:17:57.000Z","updated_at":"2025-02-21T15:54:55.000Z","dependencies_parsed_at":"2022-08-30T14:51:44.390Z","dependency_job_id":null,"html_url":"https://github.com/aap/b","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/aap%2Fb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aap%2Fb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aap%2Fb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aap%2Fb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aap","download_url":"https://codeload.github.com/aap/b/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262434,"owners_count":21074308,"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":["b","compiler"],"created_at":"2025-01-19T04:35:45.866Z","updated_at":"2025-04-10T17:53:48.665Z","avatar_url":"https://github.com/aap.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"B compiler\n==========\n\nHere you can find three B compilers.\nOne written in C and one written in B itself.\nBoth generate the original threaded code as described\n[here](http://squoze.net/B/).\n\nThe state of this repo is rather chaotic right now. sorry.\n\n## B compiler in C\n\nThis compiler I wrote to bootstrap B.\nIt is a single executable and can produce code\nfor PDP-11, amd64, mips32 and riscv64 assemblers.\nIt is good enough to compile bc.b and ba.b.\n\n## B compiler in B\n\nThis one is the real deal.\nIt works in two phases.\n`bc.b` compiles a B file to an intermediate format\nand `ba.b` further processes it to assembly.\nExcept for word size the first pass should mostly be\nplatform independent.\nThe second pass is assembler and to some degree platform\ndependent.\n\n## B for UNIX v1\n\nHaving discovered a few B binaries I set out to\nreconstruct the B compiler as closely as I could\nand get it to run on UNIX v1.\nYou can find the result in the `unix1_bdir` directory.\n\nPlatforms\n=========\nB has been confirmed to compile itself on the following platforms:\n\n- Linux amd64\n- Linux mips32 (ci20 devboard)\n- Linux riscv64\n- 2.11BSD PDP-11\n\nTODO\n====\n\n- Get rid of chaos\n- More platforms\n- make mips code work on cpus with load delay\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faap%2Fb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faap%2Fb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faap%2Fb/lists"}