{"id":13424656,"url":"https://github.com/yhirose/pl0-jit-compiler","last_synced_at":"2025-04-24T02:11:18.533Z","repository":{"id":138076436,"uuid":"117786793","full_name":"yhirose/pl0-jit-compiler","owner":"yhirose","description":"A tiny PL/0 JIT compiler in less than 900 LOC with LLVM and PEG parser.","archived":false,"fork":false,"pushed_at":"2022-09-04T03:40:27.000Z","size":52,"stargazers_count":29,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-18T09:34:33.646Z","etag":null,"topics":["compiler","cpp","jit","llvm","peg","pl0"],"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/yhirose.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}},"created_at":"2018-01-17T05:06:27.000Z","updated_at":"2024-12-11T15:16:42.000Z","dependencies_parsed_at":"2024-01-28T09:54:09.129Z","dependency_job_id":null,"html_url":"https://github.com/yhirose/pl0-jit-compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fpl0-jit-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fpl0-jit-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fpl0-jit-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirose%2Fpl0-jit-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhirose","download_url":"https://codeload.github.com/yhirose/pl0-jit-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546086,"owners_count":21448260,"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":["compiler","cpp","jit","llvm","peg","pl0"],"created_at":"2024-07-31T00:00:57.448Z","updated_at":"2025-04-24T02:11:18.516Z","avatar_url":"https://github.com/yhirose.png","language":"C++","funding_links":[],"categories":["Scripts"],"sub_categories":[],"readme":"PL/0 JIT compiler\n=================\n\nA tiny [PL/0](https://en.wikipedia.org/wiki/PL/0) JIT compiler in less than 900 LOC with LLVM and PEG parser which handles 'Divide by Zero'.\n\nLibrary dependencies:\n\n  * Parse and AST build: [cpp-peglib](https://github.com/yhirose/cpp-peglib)\n  * Code Generation: [LLVM 13.0.1](http://releases.llvm.org/13.0.1/docs/index.html)\n\nBuild on Mac OS\n---------------\n\n```sh\nbrew install llvm\nexport PATH=\"$PATH:/usr/local/opt/llvm/bin\"\nmake\n```\n\nUsage\n-----\n\n```sh\n\u003e cat samples/square.pas\nVAR x, squ;\n\nPROCEDURE square;\nBEGIN\n   squ := x * x\nEND;\n\nBEGIN\n   x := 1;\n   WHILE x \u003c= 10 DO\n   BEGIN\n      CALL square;\n      ! squ;\n      x := x + 1\n   END\nEND.\n\n\u003e pl0 samples/square.pas\n1\n4\n9\n16\n25\n36\n49\n64\n81\n100\n```\n\nBenchmark with Fibonacci number [0, 35)\n---------------------------------------\n\n```sh\n\u003e make bench\n*** Python ***\nreal\t0m8.367s\nuser\t0m8.153s\nsys\t0m0.129s\n\n*** Ruby ***\nreal\t0m3.064s\nuser\t0m2.916s\nsys\t0m0.097s\n\n*** PL/0 ***\nreal\t0m0.249s\nuser\t0m0.234s\nsys\t0m0.008s\n```\n\nLicense\n-------\n\n[MIT](https://github.com/yhirose/pl0-jit-compiler/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirose%2Fpl0-jit-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhirose%2Fpl0-jit-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirose%2Fpl0-jit-compiler/lists"}