{"id":24792349,"url":"https://github.com/colleagueriley/c-minus","last_synced_at":"2025-03-24T15:26:13.197Z","repository":{"id":274394975,"uuid":"922650207","full_name":"ColleagueRiley/c-minus","owner":"ColleagueRiley","description":"An independent C-like language compiler experiment for i386.","archived":false,"fork":false,"pushed_at":"2025-01-27T02:56:29.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T03:26:06.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColleagueRiley.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":"2025-01-26T18:56:12.000Z","updated_at":"2025-01-27T02:56:32.000Z","dependencies_parsed_at":"2025-01-27T03:26:08.821Z","dependency_job_id":"0a0f9adf-5310-4652-958a-2f40d144a7e8","html_url":"https://github.com/ColleagueRiley/c-minus","commit_stats":null,"previous_names":["colleagueriley/c-minus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2Fc-minus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2Fc-minus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2Fc-minus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColleagueRiley%2Fc-minus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColleagueRiley","download_url":"https://codeload.github.com/ColleagueRiley/c-minus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245296443,"owners_count":20592215,"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":"2025-01-29T20:32:48.735Z","updated_at":"2025-03-24T15:26:13.169Z","avatar_url":"https://github.com/ColleagueRiley.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C-Minus\r\n![alt text](https://github.com/ColleagueRiley/c-minus/blob/main/logo.png?raw=true)\r\n\r\nAn independent C-like language compiler experiment for i386.\r\n\r\nThe purpose of this program is to have a better idea of how programming languages work under the hood. This compiler is not a real C compiler. The compiler is not, and probably will never be, compliant with the C standard. For the most part, performance and flexibility has been sacrficied for quick solutions.\r\n\r\nCurrently this compiler targets linux, as it uses linux syscalls. \r\n\r\n# stb_c_lexer.h\r\nC-Minus uses a modified version of `stb_c_lexer.h` for lexing C, this allows me to focus on parsing the C tokens directly to assembly. Modified aspects are labled.\r\n\r\n# current restrictions\r\n* Only 32bit variables are supported\r\n* the compiler mostly uses the `eax` register. \r\n* missing functionality (see TODO)\r\n\r\n* max number of nested stacks: 1024\r\n* max symbol length: 255\r\n* max number of symbols (per stack): 1024\r\n* max number of function arguments: 20\r\n\r\n# supported features\r\n* declarations\r\n```c\r\nint func();\r\nint a;\r\n```\r\n\r\n* definitions\r\n```c\r\nvoid func() {\r\n\r\n}\r\n\r\nint a = 5;\r\nint b = 5;\r\na = 10;\r\nb = 9\r\n```\r\n\r\n* scopes\r\n```c\r\nint a;\r\nint b;\r\nvoid func() {\r\n    int a = b;\r\n}\r\n```\r\n\r\n* functions calls\r\n\r\n```c\r\nint f = 9;\r\nvoid func(int b, int c, int e) {\r\n    int a = b;\r\n}\r\n\r\nint main() {\r\n    int g = 4;\r\n    func(1, f, g);\r\n}\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolleagueriley%2Fc-minus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolleagueriley%2Fc-minus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolleagueriley%2Fc-minus/lists"}