Go to file
2024-11-05 17:14:13 -06:00
src readme 2024-11-05 17:14:13 -06:00
.gitignore tokens 2024-07-15 03:22:56 -05:00
Cargo.lock added structs 2024-10-22 11:27:39 -05:00
Cargo.toml added structs 2024-10-22 11:27:39 -05: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 readme 2024-11-05 17:14:13 -06:00
test.wasm IR working, fixed function call ABI 2024-11-04 00:51:24 -06:00
test.wat IR working, fixed function call ABI 2024-11-04 00:51:24 -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;
  if number == 0 {
    println("Input cannot be zero");
    break sum; // Early return
  }
  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.