{"id":42376186,"url":"https://github.com/illiafox/dumbc","last_synced_at":"2026-01-27T20:49:43.919Z","repository":{"id":301957308,"uuid":"1010716607","full_name":"illiafox/dumbc","owner":"illiafox","description":"Small C compiler written for learning by following Nora Sandler’s \"Write a Compiler\" series","archived":false,"fork":false,"pushed_at":"2025-07-19T16:56:29.000Z","size":172,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-19T20:13:26.858Z","etag":null,"topics":["arm64","c","c-compiler","compiler","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/illiafox.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-06-29T16:54:11.000Z","updated_at":"2025-07-19T17:02:02.000Z","dependencies_parsed_at":"2025-06-29T20:32:01.362Z","dependency_job_id":"b062e577-3e89-4f68-9a5e-d6685951f3c3","html_url":"https://github.com/illiafox/dumbc","commit_stats":null,"previous_names":["illiafox/dumbc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/illiafox/dumbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiafox%2Fdumbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiafox%2Fdumbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiafox%2Fdumbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiafox%2Fdumbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/illiafox","download_url":"https://codeload.github.com/illiafox/dumbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illiafox%2Fdumbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28822097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T18:44:20.126Z","status":"ssl_error","status_checked_at":"2026-01-27T18:44:09.161Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["arm64","c","c-compiler","compiler","rust"],"created_at":"2026-01-27T20:49:42.406Z","updated_at":"2026-01-27T20:49:43.910Z","avatar_url":"https://github.com/illiafox.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dumbc — small C Compiler\n\n\u003e A small C compiler written for learning.\n\nBuilt by following [Nora Sandler’s \"Write a Compiler\"](https://norasandler.com/2017/11/29/Write-a-Compiler.html) series.\n\n[![Tests](https://github.com/illiafox/dumbc/actions/workflows/test.yaml/badge.svg)](https://github.com/illiafox/dumbc/actions/workflows/test.yaml)\n\n---\n\n## Supported Architectures\n\n- **arm64** (darwin and linux only)\n\n---\n\n## Implemented Parts\n\n- [x] Part 1: Compile `int main() { return \u003cint\u003e; }`\n- [x] Part 2: Add unary operators (`-`, `~`, `!`)\n- [x] Part 3: Add binary operators (`+`, `-`, etc.)\n- [x] Part 4: Even More Binary Operators (`\u0026\u0026`, `||`, `==`, `!=`, `\u003c`, `\u003c=`, `\u003e`, `\u003e=`)\n- [x] Part 4.1: Other Binary Operators (`%`, `\u0026`, `|`, `^`, `\u003c\u003c`, `\u003e\u003e`)\n- [x] Part 5: Local Variables\n- [x] Part 5.1: \n  - Compound Assignment Operators (`+=`,`-=`,`/=`,`*=`,`%=`,`\u003c\u003c=`,`\u003e\u003e=`,`\u0026=`,`|=`,`^=`)\n  - Increment/Decrement(`++`/`--`)\n  - Comma operators (`int a = 2, b, c = a + 4;`)\n- [x] Part 6: Conditionals\n- [x] Part 7: Compound Statements\n- [x] Part 8: Loops\n- [x] Part 9: Functions (with calls to the C standard library!)\n- [x] Part 10: Global Variables\n- [ ] Part II of [_Writing a C Compiler_](https://norasandler.com/2022/03/29/Write-a-C-Compiler-the-Book.html) book\n  - floating-point numbers\n  - arrays and pointers\n  - structs\n- [ ] Constants\n- [ ] Optimizations\n  - [x] constant folding\n  - [ ] dead code elimination\n---\n\n## Usage\n\n### Compile and run a `.c` file:\n\n```bash\ncargo run -- path/to/file.c [--arch arm64] [--platform macos|linux]\n```\n\n- If `--arch` is not specified, the system architecture is used. Same for `--platform`\n- Only arm64 is supported now\n\n### Example:\n\n```bash\ncargo run -- examples/return_42.c\n```\n\nProduces `return_42.s`\n\nYou can compile it with aarch64 GCC or run with QEMU.\n\nExample for macOS:\n```bash\nclang -arch arm64 -o return_42_mac return_42.s\n./return_42\necho $?  # prints: 42\n```\n\n## Non-standard features\n\n### `bingus` keyword\n`bingus(arg)` is a built-in pseudo-function, which evaluates expression and prints it into stdout. Available on macOS platform\n\n**DEPRECATED**: calls to the standard library functions are supported\n\nExample:\n```c\nint main() {\n    int a = 10, b = 8;\n    bingus(a);\n    bingus(a * b);\n    bingus(b - 10);\n}\n```\nOutput:\n```\n10\n80\n-2\n```\n\n## Tests\nThe `testsuite` submodule contains tests cases from [`nlsandler/write_a_c_compiler`](https://github.com/nlsandler/write_a_c_compiler). \n\nTo run them, use\n```bash\npython run_tests.py\n```\n\n## License\n\nThis compiler is licensed under the **GNU General Public License**, as described in the `LICENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filliafox%2Fdumbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filliafox%2Fdumbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filliafox%2Fdumbc/lists"}