Skip to content
/ tox Public

Tox is a statically typed version programming language that is written in rust.

License

Notifications You must be signed in to change notification settings

Lapz/tox

Repository files navigation

Tox


This 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.

It's built using salsa and rowan and codespan. The design is inspired by rust-analyzer along with other projects.

Example Program

fn fib(n:int) -> int {
    if (n < 2)
      return n;
    return fib(n - 2) + fib(n - 1);
}

A simple example that makes of uses of the classes

class Toggle {
    state:bool;

    fn value() -> bool {
      return this.state;
    }

    fn activate() -> Toggle {
      this.state = !this.state;
      return this;
    }
}

fn main() {
  var toggle  = Toggle{state:true};

  print toggle.activate().value();

  print toggle.activate().value();
}

Screenshots

TODO

  • Error when type is defined multiple times
  • Add resolve imports to ctx
  • Error when a function is used as a type
  • Error on duplicate pattern bindings in the same statement
  • Warn on unused pattern variable
  • Lower structural and struct methods
  • Lower enums
  • Resolve enums
  • Resolve external imports
  • Lower field access
  • Resolve class field access
  • Lower class literal
  • Resolve class literal
  • Infer types
  • [] Codegen
  • [] Finish of the VM
  • [] Add support for closures

Build

Generate the ast

cargo run -p=tools -- -s -g=syntax/src/grammer.ron -t=syntax/src/ast.rs.tera

Resources

About

Tox is a statically typed version programming language that is written in rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages