by Jeff Walker
High performance language with deterministic safe resource management, and guaranteed thread safety.
  • Object lifetimes
  • Write once, compile anywhere
  • Guaranteed optimizations
  • Asynchronous everywhere
  • Type inference
  • Generics with partial specialization
  • Class defined traits
  • Compile time code execution
  • Optional exception specifications
  • Ergonomic design
  • Minimal runtime library
public fn newer_car[$a](c1: Car$> a, c2: Car$> a) -> Car$< a
{
    return if c1.model_year >= c2.model_year => c1
           else => c2;
}

public fn main() -> int
{
    let c17 = new Car(2017);
    let c18 = new Car(2018);
    let newer = newer_car(c17, c18); // lifetime $a is inferred
    return newer.model_year;
}
Information updated 03/11/19
View Comments