{"id":13466295,"url":"https://github.com/rui314/8cc","last_synced_at":"2025-05-14T08:05:34.144Z","repository":{"id":2587101,"uuid":"3568543","full_name":"rui314/8cc","owner":"rui314","description":"A Small C Compiler","archived":false,"fork":false,"pushed_at":"2024-05-02T15:13:48.000Z","size":1309,"stargazers_count":6242,"open_issues_count":41,"forks_count":755,"subscribers_count":248,"default_branch":"master","last_synced_at":"2025-05-07T14:12:20.674Z","etag":null,"topics":[],"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/rui314.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":"2012-02-28T06:01:01.000Z","updated_at":"2025-05-06T23:04:43.000Z","dependencies_parsed_at":"2022-07-12T14:57:52.775Z","dependency_job_id":"9afceb5c-4287-4c2a-9976-80c24f3bccfb","html_url":"https://github.com/rui314/8cc","commit_stats":{"total_commits":756,"total_committers":13,"mean_commits":58.15384615384615,"dds":0.03968253968253965,"last_synced_commit":"b480958396f159d3794f0d4883172b21438a8597"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui314%2F8cc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui314%2F8cc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui314%2F8cc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rui314%2F8cc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rui314","download_url":"https://codeload.github.com/rui314/8cc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101588,"owners_count":22014907,"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-07-31T15:00:42.136Z","updated_at":"2025-05-14T08:05:29.128Z","avatar_url":"https://github.com/rui314.png","language":"C","readme":"8cc C Compiler\n==============\n\nNote: 8cc is no longer an active project. The successor is\n[chibicc](https://github.com/rui314/chibicc).\n\n8cc is a compiler for the C programming language.\nIt's intended to support all C11 language features\nwhile keeping the code as small and simple as possible.\n\nThe compiler is able to compile itself.\nYou can see its code both as an implementation of the C language\nand as an example of what this compiler is able to compile.\n\n8cc's source code is carefully written to be as concise and easy-to-read\nas possible, so that the source code becomes good study material\nto learn about various techniques used in compilers.\nYou may find the lexer, the preprocessor and the parser are\nalready useful to learn how C source code is processed at each stage.\n\nIt's not an optimizing compiler.\nGenerated code is usually 2x or more slower than GCC.\nI plan to implement a reasonable level of optimization in the future.\n\n8cc supports x86-64 Linux only. I have no plan to make it portable until\nI fix all known miscompilations and implement an optimization pass.\nAs of 2015, I'm using Ubuntu 14 as my development platform.\nIt should work on other x86-64 Linux distributions though.\n\nNote: Do not have high expectations on this compiler.\nIf you try to compile a program other than the compiler itself,\nthere's a good chance to see compile errors or miscompilations.\nThis is basically a one-man project, and I have spent only a few\nmonths of my spare time so far.\n\nBuild\n-----\n\nRun make to build:\n\n    make\n\n8cc comes with unit tests. To run the tests, give \"test\" as an argument:\n\n    make test\n\nThe following target builds 8cc three times to verify that\nstage1 compiler can build stage2, and stage2 can build stage3.\nIt then compares stage2 and stage3 binaries byte-by-byte to verify\nthat we reach a fixed point.\n\n    make fulltest\n\nAuthor\n------\n\nRui Ueyama \u003crui314@gmail.com\u003e\n\n\nLinks for C compiler development\n--------------------------------\n\nBesides popular books about compiler, such as the Dragon Book,\nI found the following books/documents are very useful\nto develop a C compiler.\nNote that the standard draft versions are very close to the ratified versions.\nYou can practically use them as the standard documents.\n\n-   LCC: A Retargetable C Compiler: Design and Implementation\n    http://www.amazon.com/dp/0805316701,\n    https://github.com/drh/lcc\n\n-   TCC: Tiny C Compiler\n    http://bellard.org/tcc/,\n    http://repo.or.cz/w/tinycc.git/tree\n\n-   C99 standard final draft\n    http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf\n\n-   C11 standard final draft\n    http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf\n\n-   Dave Prosser's C Preprocessing Algorithm\n    http://www.spinellis.gr/blog/20060626/\n\n-   The x86-64 ABI\n    http://www.x86-64.org/documentation/abi.pdf\n","funding_links":[],"categories":["Compiler","C","排序","C/C++"],"sub_categories":["编译器"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frui314%2F8cc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frui314%2F8cc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frui314%2F8cc/lists"}