{"id":26818868,"url":"https://github.com/milesbarr/plx","last_synced_at":"2025-03-30T05:15:33.820Z","repository":{"id":237865746,"uuid":"791343417","full_name":"milesbarr/plx","owner":"milesbarr","description":"A programming language compiler written in C.","archived":false,"fork":false,"pushed_at":"2024-05-15T14:16:55.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T05:15:29.928Z","etag":null,"topics":["c","c-lang","c-language","compiler","compiler-construction","compiler-design","compilers","programming-language","programming-language-development","programming-languages"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milesbarr.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-24T14:46:25.000Z","updated_at":"2025-03-08T17:56:16.000Z","dependencies_parsed_at":"2024-05-03T12:22:22.179Z","dependency_job_id":"02e8cba4-a8a6-41ab-b1f6-3dfa05af519f","html_url":"https://github.com/milesbarr/plx","commit_stats":null,"previous_names":["milesbarr/programming-language-x","milesbarr/plx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fplx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fplx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fplx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesbarr%2Fplx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milesbarr","download_url":"https://codeload.github.com/milesbarr/plx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277358,"owners_count":20751549,"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","c-lang","c-language","compiler","compiler-construction","compiler-design","compilers","programming-language","programming-language-development","programming-languages"],"created_at":"2025-03-30T05:15:33.080Z","updated_at":"2025-03-30T05:15:33.807Z","avatar_url":"https://github.com/milesbarr.png","language":"C","readme":"# Programming Language X\n\nProgramming Language X is a compiler written in C.\n\n## Current State\n\nThe compiler implements parsing, name resolution, type checking, and code generation for a limited number of programming language features and includes two backends: [LLVM IR](https://llvm.org/docs/LangRef.html) and [WebAssembly](https://webassembly.org/).\n\n## Building\n\nIn order to build the compiler from source, [CMake](https://cmake.org/) and a C compiler such as [Clang](https://clang.llvm.org/) or [GCC](https://gcc.gnu.org/) is required. First, ensure these dependencies are installed on your system. Next, clone this repository and open a shell in the directory. Lastly, build the compiler by running the following commands:\n\n```bash\nmkdir build\ncd build\ncmake ..\ncmake --build .\n```\n\n## Syntax\n\n### Definitions\n\nDefine a constant.\n\n```go\nconst foo = 1;\n```\n\nDefine a variable.\n\n```go\nvar foo = 1;\n```\n\nDeclare a variable.\n\n```go\nvar foo: s32;\n```\n\nDefine a function.\n\n```go\nfunc foo(bar: s32) -\u003e s32 {\n  return bar;\n}\n```\n\n### Types\n\nInteger types:\n\n```go\ns8\ns16\ns32\ns64\nu8\nu16\nu32\nu64\n```\n\nFloating point types:\n\n```go\nf32\nf64\n```\n\nBoolean type:\n\n```go\nbool\n```\n\nFunction types:\n\n```go\nfunc (s32) -\u003e s32\n```\n\nArray types:\n\n```go\n[8]s32\n```\n\nSlice types:\n\n```go\n[]s32\n```\n\n## Examples\n\nAdd two integers.\n\n```go\nfunc add(a: s32, b: s32) -\u003e s32 {\n  return a + b;\n}\n```\n\nFibonacci sequence.\n\n```go\nfunc fib(n: s32) -\u003e s32 {\n  if n == 0 {\n    return 0;\n  } else if n == 1 or n == 2 {\n    return 1;\n  } else {\n    return fib(n - 1) + fib(n - 2);\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesbarr%2Fplx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilesbarr%2Fplx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesbarr%2Fplx/lists"}