{"id":20778123,"url":"https://github.com/fergusq/pscript","last_synced_at":"2025-10-24T16:45:39.241Z","repository":{"id":75146361,"uuid":"61953037","full_name":"fergusq/pscript","owner":"fergusq","description":"PScript is a small programming language","archived":false,"fork":false,"pushed_at":"2018-03-22T22:25:18.000Z","size":1601,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T22:14:48.517Z","etag":null,"topics":["compiler","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fergusq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-06-25T17:00:08.000Z","updated_at":"2023-01-29T04:49:03.000Z","dependencies_parsed_at":"2023-03-01T22:30:36.946Z","dependency_job_id":null,"html_url":"https://github.com/fergusq/pscript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fergusq/pscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fergusq%2Fpscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fergusq%2Fpscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fergusq%2Fpscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fergusq%2Fpscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fergusq","download_url":"https://codeload.github.com/fergusq/pscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fergusq%2Fpscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006455,"owners_count":26084107,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["compiler","programming-language"],"created_at":"2024-11-17T13:19:22.474Z","updated_at":"2025-10-11T06:12:10.423Z","avatar_url":"https://github.com/fergusq.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"PScript\n=======\n\nPScript is a small programming language based on a concept called _models_,\nwhich are similar to type classes in Haskell or traits in Rust. To put it\nsimply, a model is like an interface in Java (a collection of method\nsignatures). The difference between interfaces and models is that the\nimplementations of the methods must not be defined when defining a type, since\nthey can be declared anywhere in the code. One can use models to extend\nexisting types to support new functionalities.\n\nTwo of the most striking features of the language are:\n* No inheritance\n* No classes with methods, only structures with fields, every method comes from\n  a model\n\nBelow is an example of a model declaration.\n\n```\nmodel Squarable {\n\t$ square();\n}\n\nextend Int : Squarable {\n\tInt square() {\n\t\treturn this*this;\n\t}\n}\n```\n\nThe dollar type `$` represents the type for which the method is implemented,\n`Int` in this case.\n\nSee DOC.md for more information.\n\n## Building\n\nTo build the compiler, you need the Happy parser generator and Cabal installed. The program itself has following dependencies:\n\n* base\n* containers\n* directory\n* mtl\n* split\n\nCommands:\n\n    happy src/Parser.y\n    cabal build\n\n## Features / TODO\n\n### Compiler\n\n- [x] Successfully compiles all tests\n- [x] All tests pass\n- [x] Module search path\n- [ ] Meaningful error messages (half-done)\n- [ ] Validation of type parametrized declarations\n- [ ] Compiling multiple modules to multiple filesS\n- [ ] Disable the exponential growth of size of the resulting C-file when using intersection types\n\n### Language\n\n- Modules\n  - [x] Module declarations\n  - [x] Importing modules\n  - [x] Importing external C-functions\n  - [ ] Header files?\n- Literals\n  - [x] String literals\n  - [x] Integer literals\n  - [x] List literals\n  - [ ] Floating point literals\n  - [ ] Character literals\n- Expressions\n  - [x] Lambda functions\n  - [x] Explicit type casts\n  - [x] Function pointers\n- Declarations\n  - [x] Models\n    - [x] Extensions\n    - [x] Model prerequisites\n    - [ ] Model inheritance\n  - [x] Structs\n  - [x] Enums\n- Generics\n  - [x] The dollar type\n  - [x] Type parametrization of types\n  - [x] Type parametrization of functions\n- Type inference\n  - [x] Variable type inference\n  - [x] Type parameter inference\n  - [x] List type inference\n  - [x] Lambda type inference\n  - [ ] Inference using supertypes\n  - [ ] Inference of object type using method parameters\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffergusq%2Fpscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffergusq%2Fpscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffergusq%2Fpscript/lists"}