Zephyr is a statically, strongly typed language which compiles to assembly. Currently supported is Linux x86_64.
As Zephyr is self-hosted, it must be bootstrapped first.
The assembly files in the ./bootstrap directory can be used for this.
Firstly, you must have yasm installed into your $PATH.
To sync the bootstrap files you may need to run:
$ git lfs pull$ make bootstrap
$ ./build/zephyr -o ./build/zephyr ./src/main.zpr
$ ./build/zephyr -o ./build/zephyr ./src/main.zpr
$ ./build/zephyr -o ./build/zephyr ./src/main.zpr
$ ...$ yasm -felf64 -o ./bootstrap/bootstrap_x86_64_linux.o ./bootstrap/bootstrap_x86_64_linux.yasm
$ ld -o ./bootstrap/bootstrap_x86_64_linux ./bootstrap/bootstrap_x86_64_linux.o
$ ./bootstrap/bootstrap_x86_64_linux -o ./build/zephyr ./src/main.zpr
$ ./build/zephyr -o ./build/zephyr ./src/main.zpr
$ ./build/zephyr -o ./build/zephyr ./src/main.zpr
$ ./build/zephyr -o ./build/zephyr ./src/main.zpr
$ ...import "std/io.zpr";
function main(): int {
putsln("Hello, World!");
return 0;
}
import "std/io.zpr";
function main(): int {
var file = fopen("./myfile.txt", 'w');
file.putsln("Hello, Zephyr FileIO!");
file.close();
return 0;
}
import "std/io.zpr";
struct Person {
name: i8*;
}
function Person.constructor(name: i8*) {
this.name = name;
}
function Person.say_hi() {
puts("Hi, I'm "); puts(this.name); putsln("!"); // f"Hi, I'm {name}!\n"
}
function main(): int {
var alice: Person("Alice");
alice.say_hi();
return 0;
}
See ./examples for more examples of the language.
Running the bash scripts in ./tests can be used to test the language.
Running ./tests/all.sh will run all the tests and give a count of the successful, total, and skipped tests.
Due to git, you may need to change the line endings of each test file to LF instead of CRLF.