{"id":15048910,"url":"https://github.com/brandonki/jcc","last_synced_at":"2025-04-10T01:34:29.095Z","repository":{"id":234588812,"uuid":"789197767","full_name":"BrandonKi/jcc","owner":"BrandonKi","description":"Optimizing C Compiler","archived":false,"fork":false,"pushed_at":"2025-01-08T18:27:00.000Z","size":451,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T03:12:11.287Z","etag":null,"topics":["c-lang","c-language","compiler","cpp","low-level","optimization","ssa","x86-64"],"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/BrandonKi.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":"2024-04-19T22:52:25.000Z","updated_at":"2025-01-08T18:27:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"4df2de11-94f7-4e6f-ac3e-f3011127106d","html_url":"https://github.com/BrandonKi/jcc","commit_stats":{"total_commits":42,"total_committers":2,"mean_commits":21.0,"dds":"0.023809523809523836","last_synced_commit":"0a346386d394baecc303695b582993dd31cab1d7"},"previous_names":["brandonki/jcc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandonKi%2Fjcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandonKi%2Fjcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandonKi%2Fjcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandonKi%2Fjcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrandonKi","download_url":"https://codeload.github.com/BrandonKi/jcc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140925,"owners_count":21054369,"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-lang","c-language","compiler","cpp","low-level","optimization","ssa","x86-64"],"created_at":"2024-09-24T21:17:06.242Z","updated_at":"2025-04-10T01:34:29.076Z","avatar_url":"https://github.com/BrandonKi.png","language":"C++","readme":"# Just a C Compiler (jcc)\n\nC Compiler.\n\nCan use either the custom backend or llvm.\n\nThe custom backend is located in [jb/](jb/) which was previously a separate project([jb](https://github.com/BrandonKi/just-another-backend)).\n\n## Examples\n\nWIP, can currently handle a decent amount of stuff (functions, pointers, if/else, for, do/while, etc.). It even supports a decent amount of preprocessor features so far.\n\nTake a look in the [tests/](tests/) directory or commit history for a fuller picture of how much is supported.\n\nThe following is a very small example that correctly runs/compiles.\n```c\n#include \u003cstdbool.h\u003e\n\nextern int printf(char*);\n\nbool isPerfect(int num) {\n    int sum = 0;\n    for (int i = 1; i \u003c num; i++) {\n        if (num % i == 0) {\n            sum += i;\n        }\n    }\n    return sum == num;\n}\n\nint main() {\n    printf(\"Hello From JCC!\");\n    return isPerfect(28); // returns 1\n}\n```\n\n## Spec/Reference\n\n[C Spec](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf)\n\n[C preprocessor](https://www.spinellis.gr/blog/20060626/cpp.algo.pdf)\n\n[Intel x86_64 Instruction set](https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html)\n\n## Build\n\nReplace `CMAKE_PREFIX_PATH` with your `path/to/llvm`\n\n## Build(Visual Studio)\n\n```cmake\ncmake \"-DCMAKE_PREFIX_PATH:STRING=C:/Program Files/llvm-16.0.6-windows-amd64-msvc16-msvcrt-dbg\" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -B/build -G \"Visual Studio 17 2022\"\n```\n\n## Build(Clang+Ninja)\n\n```cmake\ncmake \"-DCMAKE_PREFIX_PATH:STRING=C:/Program Files/llvm-16.0.6-windows-amd64-msvc16-msvcrt-dbg\" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -B/build -GNinja\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandonki%2Fjcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandonki%2Fjcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandonki%2Fjcc/lists"}