A toy programming language inspired by bits of Rust, Go, Python, and JavaScript.
See the syntax defined here.
- Lexer
- Done: Token parsing
- Needs work:
- Source code file, line, and column location
- AST Parsing
- See yak-ast TODO for done and needs work.
- TBD: AST Validation
- AST -> IR
- Prototyped:
- Modules
- Functions
- Structs
- Constants
- Prototyped:
- IR Validation
- TBD: Type checks
- IR -> LLVM
- Prototyped:
- Modules: generates module
.ll
files - Functions (stubbed)
- Structs (stubbed)
- Constants (stubbed)
- Modules: generates module
- Prototyped:
- Linking
- Done: Links all
.ll
files and generates a package binary usingclang
- Done: Links all
This list is some of the big unknowns to figure out...
- Memory management (gc vs lifetimes/borrow. Needs more research.)
- Memory layouts (can we leverage Rust for this?)
- String vs str: which one should we start with?
- Runtime (what does this look like? Make it synchronous and see if we can leverage Rust threads/channels to start out)
YAK_HOME
: The path to use for the yak home directory.YAK_LOG
: The loglevel to use for the yak-cli binary.YAK_VERSION
: The yak version to use for the yak-cli tools.
# Define which yak version to use:
export YAK_HOME="~/.yak"
export YAK_VERSION="0.0.1"
export PATH="$YAK_HOME/yak/$YAK_VERSION/bin:$PATH"
The yak
home directory is where we store the versioned yak-cli binary, package src code, and compiled package cache.
By default, it should look like this:
~/.yak/yak/{version}
~/.yak/yak/{version}/bin
~/.yak/yak/{version}/pkg
~/.yak/yak/{version}/src
The crude beginnings of a cli have been stubbed out to support building and getting packages.
Build the yak.pkg
file in the current directory and resolve dependencies:
yak-cli build
Or, build some other local package relative to the current directory:
yak-cli build ../my/pkg1
Build artifacts should end up in the {pkg}/target/module
and {pkg}/target/bin
or {pkg}/target/lib
directories.
Download remote packages locally and build them.
yak-cli get https://raw.githubusercontent.com/grippy/yak/master/examples/yak-pkg1