{"id":26745722,"url":"https://github.com/afaanbilal/koshur-lang","last_synced_at":"2025-04-14T19:54:45.364Z","repository":{"id":218172959,"uuid":"624404125","full_name":"AfaanBilal/koshur-lang","owner":"AfaanBilal","description":"A simple programming language inspired by the Kashmiri language (Koshur)","archived":false,"fork":false,"pushed_at":"2024-02-04T17:21:57.000Z","size":74,"stargazers_count":25,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T08:18:26.525Z","etag":null,"topics":["evaluator","koshur","language","lexer","parser"],"latest_commit_sha":null,"homepage":"https://koshur.afaan.dev","language":"JavaScript","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/AfaanBilal.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":"2023-04-06T11:50:46.000Z","updated_at":"2024-02-06T18:32:16.000Z","dependencies_parsed_at":"2024-02-04T19:03:57.576Z","dependency_job_id":"2b90cf9f-0734-4045-a86d-789bf24764c3","html_url":"https://github.com/AfaanBilal/koshur-lang","commit_stats":null,"previous_names":["afaanbilal/koshur-lang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfaanBilal%2Fkoshur-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfaanBilal%2Fkoshur-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfaanBilal%2Fkoshur-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AfaanBilal%2Fkoshur-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AfaanBilal","download_url":"https://codeload.github.com/AfaanBilal/koshur-lang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952130,"owners_count":21188421,"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":["evaluator","koshur","language","lexer","parser"],"created_at":"2025-03-28T08:18:24.343Z","updated_at":"2025-04-14T19:54:45.336Z","avatar_url":"https://github.com/AfaanBilal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"🍁 koshur-lang\n===============\n\nA simple programming language inspired by the Kashmiri language (Koshur).\n\nTry it out: [Koshur Online](https://koshur.afaan.dev)\n\n---\n\n### **Author**: [Afaan Bilal](https://afaan.dev)\n\n---\n\n## Hello World\n````\nwan(\"Hello, world!\");\n````\n\n---\n## Run\n````\nnode koshur.js \u003cfilename\u003e\n````\n\nThe `filename` must be the last parameter and must end with `.k` or `.ast`.\n\n```\nnode koshur.js [--print-ast] [--write-ast] [--from-ast] \u003cfilename\u003e\n```\n- Add `--print-ast` to print the Abstract Syntax Tree.\n- Add `--write-ast` to write the Abstract Syntax Tree to a file named `filename` with extension set to `.ast`.\n- Add `--from-ast` to evaluate from an Abstract Syntax Tree loaded from `filename`. File must end with `.ast`.\n\n---\n\n## Run examples\nSee examples in the `examples/` directory.\n\n````\nnode run-examples.js\n````\n\n---\n\n## Syntax\n\nKoshur-lang has a very brief syntax. Semi-colons are required except after expressions.\n\n### Comments\n```\n# This is a comment\n```\n\n### Print to screen\n```\nwan(\"Hello!\");\n```\n\n### Variables\n```\nx = 10;\ny = 20;\n\nwan(x); # Prints 10\nwan(y); # Prints 20\n```\n\n### Control flow\n- `poz` means `true`\n- `apuz` means `false`\n- `yeli` means `if`\n- `nate` means `else`\n- `teli` means `then` and is only required after `if` when braces (`{}`) are skipped.\n\n```\nyeli poz {\n    wan(\"Poz chu!\");\n} nate {\n    wan(\"Apuz hasa!\");\n};\n\nyeli apuz teli\n    wan(\"apuz!\")\nnate\n    wan(\"poz!\");\n```\n\n### Functions\nFunctions in **koshur-lang** are lambdas.\n```\nbod-kus = banav(x, y) yeli x \u003e y teli x nate y;\n\nwan(bod-kus(10, 20)); # Prints 20\n```\nThis creates a function (lambda) named `bod-kus` which returns the bigger of the two parameters.\n\nFunctions may be multiline:\n```\nkarunPrintFibonacci = banav(hadd, aediuk, patium) {\n    yeli (hadd \u003e 0) {\n        wan(aediuk + patium);\n        karunPrintFibonacci(hadd - 1, patium, aediuk + patium);\n    } nate {\n        wan(\"Done!\");\n    }\n};\n\nkarunPrintFibonacci(10, 0, 1);\n```\nThe above code prints:\n```\n1\n2\n3\n5\n8\n13\n21\n34\n55\n89\nDone!\n```\nShortcut for `banav` is `λ`\n\n```\nlakut-kus = λ(x, y) yeli x \u003c y teli x nate y;\n\nwan(lakut-kus(10, 20)); # Prints 10\n```\nThis creates a function (lambda) named `lakut-kus` which returns the smaller of the two parameters.\n\n### Keywords\nThis is a list of all the keywords in **koshur-lang**.\n\n- yeli\n- teli\n- nate\n- poz\n- apuz\n- banav\n- λ\n\n### Operators\nThis is a list of all the operators available in **koshur-lang**.\n\n| Operator | Description        |\n| -------- | ------------------ |\n| \\+       | Addition           |\n| \\-       | Subtraction        |\n| \\*       | Multiplication     |\n| \\/       | Division           |\n| %        | Modulo (Remainder) |\n| \u0026\u0026       | Logical AND        |\n| \\|\\|     | Logical OR         |\n| \u003c        | Less than          |\n| \\\u003e       | Greater than       |\n| \u003c=       | Less or Equal      |\n| \\\u003e=      | Greater or Equal   |\n| ==       | Equals             |\n| !=       | Not Equal          |\n\n---\n\n## Contributing\nAll contributions are welcome. Please create an issue first for any feature request\nor bug. Then fork the repository, create a branch and make any changes to fix the bug\nor add the feature and create a pull request. That's it!\nThanks!\n\n---\n\n## License\n**koshur-lang** is released under the MIT License.\nCheck out the full license [here](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaanbilal%2Fkoshur-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafaanbilal%2Fkoshur-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafaanbilal%2Fkoshur-lang/lists"}