Skip to content

vcfxb/wright-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Wright Programming Language

A language that flies

Wright is an all-purpose programming language inspired by Rust, Ada, and Typescript. Pulling from all three of these excellent languages, Wright intends to offer a combination of speed, ergonomics, and precision.

Badges

Wright is automatically checked and tested using the latest available github runners for Ubuntu, MacOS, and Windows

Service Badge
Cargo Check Status Cargo Check status
Cargo Test Status Cargo Test status
Cargo Clippy Status Cargo Clippy status
Code Coverage (Coveralls) Coverage Status
Code Coverage (Codecov.io) codecov
Docs.rs Documentation
Crates.io Crates.io
GitHub release GitHub release
GitHub (pre-)release GitHub (pre-)release
Development Status Status
Downloads
Total Github All Releases
Releases Github Releases
Pre-Releases Github Pre-Releases
Crates.io Crates.io
Crates.io (Latest) Crates.io

Syntax Samples

// Hello World! 
use wright::io::println;

func main() {
    println("Hello World!");
}
// FizzBuzz 1 through 100
use wright::io::println;

type FizzBuzzInteger = integer constrain |i| { i <= 100 && i >= 0 };

func fizzbuzz(i: FizzBuzzInteger) {
    if i % 15 == 0 { println("FizzBuzz"); }
    else if i % 5 == 0 { println("Buzz"); }
    else if i % 3 == 0 { println("Fizz"); }
    else { println(i); }
}

func main() {
    // Compiler error here if we use a range iterator that contains a value violating the constraints of 
    // `FizzBuzzInteger`. 
    (1..=100).for_each(fizzbuzz);
}

The core goals of the language:

  • Developer experience -- Every error message, syntax choice, and standard library function should be friendly and well documented.
  • Robustness -- Wright's type system should be expressive enough to appropriately capture the domain, representation, and functionality of every symbol the programmer interacts with.
  • Speed -- Wright leverages the newest major version of LLVM (at the time of writing, LLVM 18), to compile code directly to assembly, avoiding the overhead of an interpreter, garbage collector, and other associated tools by default.
  • Memory Safety -- Wright pulls significant inspiration from Rust's lifetime system, with some modifications.

Installation:

There are several installation options.

  • Get the latest stable version from the releases page.
  • If you have rust, via cargo install wright.
  • Building from source, by cloning this repository, and running cargo build --release in the wright directory, and then adding wright/target/release to your system path. You will need LLVM 18 installed and appropriately configured to compile Wright. See the llvm-sys crate docs for tips on how to do this.