Go to file
2024-12-10 21:17:20 -06:00
src Laptop changes 2024-12-10 21:17:20 -06:00
.gitignore tokens 2024-07-15 03:22:56 -05:00
Cargo.lock Laptop changes 2024-12-10 21:17:20 -06:00
Cargo.toml Laptop changes 2024-12-10 21:17:20 -06:00
demo.hal readme 2024-11-05 17:14:13 -06:00
index.html Started IR again 2024-11-01 12:34:58 -05:00
readme.md Fixed readme 2024-11-05 17:15:05 -06:00
test.wasm Laptop changes 2024-12-10 21:17:20 -06:00
test.wat Laptop changes 2024-12-10 21:17:20 -06:00

Halcyon Compiler

The Halcyon language is a strongly typed compiled language for the WebAssembly virtual machine. Its major features are implicit types, move semantics, and memory safety.

Semantics

The syntax of Halcyon is designed to be minimal and readable. While Halcyon is strongly typed, types can be assumed from context at compile time. Below is an annotated "FizzBuzz" program

fizzbuzz :: (number) {
  sum := 0;
  for i : 0..number {
    if (i % 3 == 0) and (i % 5 == 0) {
      println("fizzbuzz");
      sum += 1;
    }
    else if i % 3 == 0 {
      println("fizz");
    }
    else if i % 5 == 0 {
      println("buzz");
    }
  }
  sum // return the number of fizzbuzz's
}

fizzbuzz(15);

In Depth

I have written a more comprehensive (but outdated) language specification on my blog here.