{"id":20954973,"url":"https://github.com/ysoftware/language","last_synced_at":"2025-10-11T23:36:51.876Z","repository":{"id":98074822,"uuid":"264464450","full_name":"ysoftware/Language","owner":"ysoftware","description":"An excercise in developing a programming language","archived":false,"fork":false,"pushed_at":"2021-05-02T13:46:55.000Z","size":1437,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-11T09:00:00.429Z","etag":null,"topics":["compiler","lexer","parser","programming-language-development","type-checker"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ysoftware.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":"roadmap.txt","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-16T15:15:28.000Z","updated_at":"2023-01-27T04:16:24.000Z","dependencies_parsed_at":"2023-05-23T10:45:26.944Z","dependency_job_id":null,"html_url":"https://github.com/ysoftware/Language","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ysoftware/Language","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysoftware%2FLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysoftware%2FLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysoftware%2FLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysoftware%2FLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysoftware","download_url":"https://codeload.github.com/ysoftware/Language/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysoftware%2FLanguage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009391,"owners_count":26084580,"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","lexer","parser","programming-language-development","type-checker"],"created_at":"2024-11-19T01:17:09.584Z","updated_at":"2025-10-11T23:36:51.832Z","avatar_url":"https://github.com/ysoftware.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Language\n---\n*This project has been put on hold. The work ended at implementing different kinds of arrays.*\n\n---\n## Excercise in developing a programming language\n\n\nI'm using Swift because I feel comfortable with it.\nThis is my very first experience in compiler development, therefore, I'm not taking any criticism and not reading any tutorials.\n\nI want to stumble into as many mistakes and problems as I can, and solve them on my own.\n\n## Progress:\n- [x] use LLVM to parse manually-written IR (part 1)\n- [x] generate IR from some manually written and pre-typed AST\n- [x] develop lexer (tokenizer)\n- [x] **parse code into AST**\n- [x] hook up to IR generation\n- [ ] second pass type inference\n- [x] testing AST and IR generation\n- [ ] IR generation for more complicated things (part 2)\n- [ ] static analyzer (all paths return a value, unused values)\n\n\n## Syntax Description\n\n*Declaration*\n```\na : Int = 0;        // variable \nb : Float : 0.1;    // constant\n\na := 1; // variable\nb :: 2; // constant\n```\n \n *Pointer type*\n ```\n a := 3;\n b := *a; // *Int\n ```\n \n *Procedure declaration*\n```\nfunc printf(_ format: String, _ arguments: Int32, ...) #foreign;\nfunc entry_point() -\u003e Int32 #main { ... }\n```\n \n Array Literals\n ```\n a : Int[3] = [0, 1, 2];\n b : Float[3] = [0, 1, 2]\n c := [0, 1, 2]              // Int[3] \n d := [0.1, 1, 2]            // Float[3]\n ```\n\n \n \n## Ideas Roadmap:\n\n#### If/switch expression\n```\nenum Values { A, B, C };\nvalue := Values.A;\n\nname := switch (value) {\n  case A: #provide \"A\";\n  case B: #provide \"B\";\n  case C: #provide \"C\";\n}\n\ndescription := if (name == Values.B) {\n  #provide \"The name is B.\"\n}\nelse {\n  #provide \"The name is not B.\"\n}\n\n// name == \"A\"\n// description == \"The name is not B.\"\n```\n\n#### Not-really-objective\nUse dot syntax for calling procedures where first argument is (pointer to) an instance of this structure.\nSort of like namespacing, but it will require procedure overloading to resolve collisions.\n```\nfunc append(list: List*, value: Int) -\u003e Node*;\nlist.append(1);       \n/* instead of: */ list_append(list, 1);\n```\n\n#### Polymorphic procedures\n ```\nfunc array_add(_ array: *($T[]), _ element: T);\n```\n\n#### Dynamic arrays (probably written in the language as a part of the st. lib)\n```\na := [1, 2, 3, 4, ...] // use varargs as syntax for dynamic array\n```\n\nAlso:\n- Procedures overloading\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysoftware%2Flanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysoftware%2Flanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysoftware%2Flanguage/lists"}