{"id":19899605,"url":"https://github.com/keyvank/30cc","last_synced_at":"2025-05-16T15:06:36.692Z","repository":{"id":257943702,"uuid":"863186348","full_name":"keyvank/30cc","owner":"keyvank","description":"30 C Compiler","archived":false,"fork":false,"pushed_at":"2025-01-03T07:56:44.000Z","size":543,"stargazers_count":302,"open_issues_count":9,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-14T23:58:38.580Z","etag":null,"topics":["c","compiler","educational"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keyvank.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}},"created_at":"2024-09-25T21:38:20.000Z","updated_at":"2025-05-01T20:35:52.000Z","dependencies_parsed_at":"2024-10-17T03:43:56.490Z","dependency_job_id":"3c3bb221-305d-4eb5-bc59-365fae7ee4f7","html_url":"https://github.com/keyvank/30cc","commit_stats":null,"previous_names":["keyvank/30cc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvank%2F30cc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvank%2F30cc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvank%2F30cc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvank%2F30cc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyvank","download_url":"https://codeload.github.com/keyvank/30cc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"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":["c","compiler","educational"],"created_at":"2024-11-12T20:09:14.749Z","updated_at":"2025-05-16T15:06:36.669Z","avatar_url":"https://github.com/keyvank.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 30 C Compiler!\n\n`30cc` (Pronounced as *CCC*, because in the Persian language, the number 30 is pronounced as C) is a toy C compiler written in C, which is strong enough to compile itself 🤝 This was my first attempt in writing a self-hosting software! What is a self-hosting software?\n\n- Imagine `30cc` gets strong enough to be able to compile itself.\n- I will first compile `30cc` with `gcc` to get the `30cc` compiler's binary.\n- I will then use the `gcc`-generated `30cc` binary file to compile the `30cc` again.\n- I now have a `30cc`-compiled version of `30cc`, which I can use for further developing the compiler!\n- I can forget about `gcc`, as if it never existed! Beautiful hah? `30cc` is now all alive by itself!\n\n`30cc` emits x86-64 assembly as its output. The outputs are totally unoptimized, but that's fine, the project aims to be educational.\n\n## Usage\n\nBootstrap the compiler by running `make`. This will generate 3 different versions of 30cc compiler:\n\n1. `30cc_gcc` which is the bootstrapped gcc-compiled version of 30cc\n2. `30cc_30cc` which is the output of gcc-compiled 30cc compiler, compiling the 30cc compiler\n3. `30cc` which is the output of 30cc-compiled 30cc compiler, compiling the 30cc compiler\n\nRunning independent source-files through `make`:\n\n```\nmake run program=./examples/inp.c arguments=something\n```\n\n## Contribute\n\n### Tests\n\nTo run tests use\n```\npython scripts/test.py update\n```\n\nThen check the output of the tests.\n\nIf you are on mac use `./scripts/test_mac.sh` to run the tests in docker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvank%2F30cc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyvank%2F30cc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvank%2F30cc/lists"}