{"id":13672347,"url":"https://github.com/Lapz/tox","last_synced_at":"2025-04-27T21:32:51.140Z","repository":{"id":27370808,"uuid":"111136253","full_name":"Lapz/tox","owner":"Lapz","description":"Tox is a statically typed version programming language that is written in rust.","archived":false,"fork":false,"pushed_at":"2023-01-20T22:56:33.000Z","size":8684,"stargazers_count":36,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T09:11:57.324Z","etag":null,"topics":["programming-language","rust","vm"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Lapz.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":"2017-11-17T18:16:17.000Z","updated_at":"2024-02-07T22:16:06.000Z","dependencies_parsed_at":"2023-02-12T06:31:05.517Z","dependency_job_id":null,"html_url":"https://github.com/Lapz/tox","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/Lapz%2Ftox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapz%2Ftox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapz%2Ftox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lapz%2Ftox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lapz","download_url":"https://codeload.github.com/Lapz/tox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224087256,"owners_count":17253522,"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":["programming-language","rust","vm"],"created_at":"2024-08-02T09:01:32.998Z","updated_at":"2024-11-11T10:30:40.502Z","avatar_url":"https://github.com/Lapz.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Tox\n\n![](https://github.com/lapz/tox-rewrite/workflows/CI/badge.svg)\n[![](https://tokei.rs/b1/github/lapz/tox-rewrite?category=code)](https://github.com/lapz/tox-rewrite)\n\u003cbr /\u003e\nThis is the new experimental version of Tox.I've been working on this slowly but I do have a working lexer plus parser and I've started on semantic analysis.\n\nIt's built using salsa and rowan and codespan. The design is inspired by rust-analyzer along with other projects.\n\n## Example Program\n\n```ts\nfn fib(n:int) -\u003e int {\n    if (n \u003c 2)\n      return n;\n    return fib(n - 2) + fib(n - 1);\n}\n```\n\nA simple example that makes of uses of the classes\n\n```rust\nclass Toggle {\n    state:bool;\n\n    fn value() -\u003e bool {\n      return this.state;\n    }\n\n    fn activate() -\u003e Toggle {\n      this.state = !this.state;\n      return this;\n    }\n}\n\nfn main() {\n  var toggle  = Toggle{state:true};\n\n  print toggle.activate().value();\n\n  print toggle.activate().value();\n}\n```\n\n## Screenshots\n\n\u003cimg src='./assets/program.png' width=250\u003e\n\u003cimg src='./assets/errors.png' width=250\u003e\n\u003cimg src='./assets/bar.png' width=250\u003e\n\n## TODO\n\n- [x] Error when type is defined multiple times\n- [x] Add resolve imports to ctx\n- [x] Error when a function is used as a type\n- [x] Error on duplicate pattern bindings in the same statement\n- [x] Warn on unused pattern variable\n- [x] Lower structural and struct methods\n- [x] Lower enums\n- [x] Resolve enums\n- [x] Resolve external imports\n- [x] Lower field access\n- [x] Resolve class field access\n- [x] Lower class literal\n- [x] Resolve class literal\n- [x] Infer types\n- [] Codegen\n- [] Finish of the VM\n- [] Add support for closures\n\n## Build\n\nGenerate the ast\n\n```bash\ncargo run -p=tools -- -s -g=syntax/src/grammer.ron -t=syntax/src/ast.rs.tera\n```\n\n## Resources\n\n- [rust](https://github.com/rust-lang/rust)\n- [plank](https://github.com/jDomantas/plank)\n- [lox](http://www.craftinginterpreters.com)\n- [menhir-lang](https://github.com/GeorgeKT/menhir-lang)\n- [minicom](https://github.com/agatan/minicom)\n- [tiger-rs](https://github.com/antoyo/tiger-rs)\n- [Kaleidoscope](https://llvm.org/docs/tutorial/index.html)\n- [kaleidoscope-rs](https://github.com/BookOwl/kaleidoscope-rs)\n- [inko](https://gitlab.com/yorickpeterse/inko)\n- [NovaLang](https://github.com/boomshroom/NovaLang)\n- [gluon](https://github.com/gluon-lang/gluon)\n- [dora](https://github.com/dinfuehr/dora)\n- Modern Compiler Implementation in [ML](http://www.cs.princeton.edu/~appel/modern/ml/), [java](http://www.cs.princeton.edu/~appel/modern/java/) and [C](https://www.cs.princeton.edu/~appel/modern/c/)\n- [Developing Statically Typed Programming Language](http://blog.mgechev.com/2017/08/05/typed-lambda-calculus-create-type-checker-transpiler-compiler-javascript/)\n- [/r/ProgrammingLanguages](https://www.reddit.com/r/ProgrammingLanguages/)\n- [awesome-compilers](https://github.com/aalhour/awesome-compilers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLapz%2Ftox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLapz%2Ftox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLapz%2Ftox/lists"}