Yo is a compiled programming language with strong static typing.
#[extern] fn puts(*i8);
fn main() -> i32 {
puts(b"Hello World");
return 0;
}
Learn more
Usage
Building Yo
$ git clone https://github.com/lukaskollmer/yo
$ cd mkdir yo/build && cd yo/build
$ cmake .. && make
Build requirements:
- Make
- CMake 3.11+
- Python 3.6+
- LLVM 8
- A C++17 compatible compiler
Build artifacts
bin/yo
: the compiler itselfbin/yo-demangle
: a symbol demangler
Command Line Interface
$ ./yo -help
OVERVIEW: The Yo Programming Language v0.0.1
USAGE: yo [options] <input file>
OPTIONS:
General Options:
-O - Enable optimizations
-dump-llvm - Dump LLVM IR to stdout
-dump-llvm-pre-opt - Dump LLVM IR to stdout, prior to running optimizations
-emit - Output format(s)
=asm - Assembly
=llvm-ir - LLVM IR
=llvm-bc - LLVM Bitcode
=bin - Binary
=obj - Object File
=none - None
-fno-inline - Disable all function inlining
-fzero-initialize - Allow uninitialized variables and zero-initialize them
-g - Emit debug metadata
-print-ast - Print the Abstract Syntax Tree to stdout
-run - Run the generated executable after codegen. Implies `--emit bin`
-run-args=<string> - Argv to be used when executing the produced binary. Implies `-run`
-stdlib-root=<path> - Load stdlib modules from <path>, instead of using the bundled ones
Generic Options:
-help - Display available options (-help-hidden for more)
-help-list - Display list of available options (-help-list-hidden for more)
-version - Display the version of this program
Useful options inherited from LLVM
--x86-asm-syntax={intel|att}
Use in conjunction with--emit asm
to set the assembly style to be emitted by LLVM's x86 backend. Defaults toatt
.