{"id":18668698,"url":"https://github.com/franeklubi/luxya","last_synced_at":"2025-04-12T00:23:52.278Z","repository":{"id":49996525,"uuid":"323978027","full_name":"franeklubi/luxya","owner":"franeklubi","description":"Programming language with a tree-walking interpreter written in Rust©™.","archived":false,"fork":false,"pushed_at":"2021-11-12T09:28:22.000Z","size":285,"stargazers_count":28,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T20:11:46.918Z","etag":null,"topics":["interpreted-programming-language","interpreter","lox","lox-language","programming-language","programming-languages","rust","tree","tree-walk-interpreter","tree-walker"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/franeklubi.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}},"created_at":"2020-12-23T18:46:39.000Z","updated_at":"2025-02-05T13:00:21.000Z","dependencies_parsed_at":"2022-08-29T06:21:53.331Z","dependency_job_id":null,"html_url":"https://github.com/franeklubi/luxya","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franeklubi%2Fluxya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franeklubi%2Fluxya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franeklubi%2Fluxya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franeklubi%2Fluxya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franeklubi","download_url":"https://codeload.github.com/franeklubi/luxya/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248498596,"owners_count":21114148,"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":["interpreted-programming-language","interpreter","lox","lox-language","programming-language","programming-languages","rust","tree","tree-walk-interpreter","tree-walker"],"created_at":"2024-11-07T08:44:37.898Z","updated_at":"2025-04-12T00:23:52.256Z","avatar_url":"https://github.com/franeklubi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# luxya ✨\n\nLuxya is a [Lox](https://github.com/munificent/craftinginterpreters)-based programming language with a tree-walking interpreter *written in Rust©™*.\n\n![luxya logo](./assets/luxya_logo.png)\n\nTo download precompiled binaries for GNU/Linux and Windows visit the [releases](https://github.com/franeklubi/luxya/releases) page!\n\n\n---\n* [Lox-luxya differences](#lox-luxya-differences)\n\t* [Additions](#additions)\n\t* [Syntax](#syntax-differences)\n\t* [Backend](#backend-differences)\n\t* [Native functions](#native-functions)\n* [Usage](#usage)\n* [Examples](#examples)\n* [Compilation and development](#compilation-and-development)\n---\n\n\n## Lox-luxya differences\n### [Additions](./doc/additions.md):\n- **lists!**; [read more](./doc/additions.md#lists)\n- square bracket accessor (`[expression]`); [read more](./doc/additions.md#square-bracket-accessor)\n- grouping accessor (`.(expression)`); [read more](./doc/additions.md#grouping-accessor)\n- full object notation; [read more](./doc/additions.md#objects)\n- chars; [read more](./doc/additions.md#chars)\n- the modulo (`%`) operator\n\n### Syntax differences:\n- function declarations are expressions, rather than statements, so you can create anonymous (but not strictly) functions you want to use in-place: `function_name(10, a, fun () { print \"callback\" })`\n- introduced `let` instead of `var`, and `const` for immutable declarations\n- `if`'s, `else`'s, and `for`'s body has to be a block\n- `if`s condition doesn't need to be a grouping (basically you can do: `if true { ... }`)\n- although there is no type coercion, any value that's not strictly `true` will be treated as `not true` when placed in `if`'s or `for`'s condition\n- `for`'s initialization consists of three, **not** grouped fields (e.g.: `for let i = 0; i \u003c 10; i = i + 1 { ... }`)\n- there are no `while` loops, but you can achieve the same behaviour with `for` (`while true { ... }` is the same as `for ; true; { ... }`)\n- you can state an infinite loop by omitting every field: `for ;; {}`\n- `init` (Lox's constructor method) is named `constructor`\n- you cannot call an instance's `constructor` directly (`constructor`s are only callable by using `Classname()` or `super()`)\n- to call a superclass's constructor you need to call the `super` keyword, as you would a function\n- inheritance is done with the `extends` keyword, replacing the `\u003c` syntax\n- chars, which you can read more about [here](./doc/additions.md#chars)\n\n### Backend differences:\n- numbers are `IEEE 754-2008` compliant (rust's f64 underneath)\n- no type coercion, no truthy nor falsy values\n- no visitor pattern\n- reference counting because there's no garbage collector to leverage\n- shadowing of named values is permitted\n\n### Native functions:\nYou can find full list of native functions [here](./doc/native_functions.md)\n\n\n## Usage\nTo run any script source run:\n```sh\n$ luxya \u003csource\u003e\n```\n\nTo run in REPL mode (which is not yet finished):\n```sh\n$ luxya\n```\n\n\n## Examples\n```lux\nfor let i = 0; i \u003c 10; i = i + 1 {\n\tprint i;\n}\n```\n```lux\nfun shout(text) {\n\tprint text + \"!\";\n}\n\nshout(\"hi\");\n```\n```lux\nclass Language {\n\tconstructor(name) {\n\t\tthis.name = name;\n\t}\n\n\tsay_language() {\n\t\tprint this.name;\n\t}\n}\n\nclass Luxya extends Language {\n\tconstructor() {\n\t\tsuper(\"luxya\");\n\t}\n\n\tsay_language() {\n\t\tprint \"✨✨✨\";\n\t\tsuper.say_language();\n\t\tprint \"✨✨✨\";\n\t}\n}\n\nconst luxya = Luxya();\n\nluxya.say_language();\n```\n\n\n## Compilation and development\nThe source comprises two parts:\n- the `src/ast/*` generated by `tools/generate_ast.py`\n- the rest\n\nTo get a release build you can use `just`:\n```sh\n$ just\n```\nOr use cargo:\n```sh\n$ cargo build --release --verbose\n```\n\nThere are also a couple of useful dev commands like:\n```sh\n# run REPL in watch mode\n$ just watch\n\n# run the `sample_program.lux` in watch mode\n# (script source overridable with sample_program_path in justfile)\n$ just watch_sample\n\n# run the `generate_ast.py` script with mypy checks in watch mode\n# (script source overridable with generate_ast_path in justfile)\n$ just watch_generate_ast\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraneklubi%2Fluxya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffraneklubi%2Fluxya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraneklubi%2Fluxya/lists"}