Get Started
Quick Start
Install requirements
Requirements
To compile a joelang program, you'll need
Requirement Version Verify via Node.js & NPM 18.x node -v
andnpm -v
clang 3.26.4 clang --version
llvm 14.0.6 llvm-config --version
orllvm-config-14 --version
gcc 12.2.0 gcc --version
bashcurl -sL https://deb.nodesource.com/setup_18.x | sudo bash sudo apt install -y nodejs clang llvm-14 gcc
bashbrew install node llvm@14 gcc
ps1# Install Chocolatey package manager Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install nodejs mingw choco install llvm --version=14.0.6
Download binary https://github.com/josephzidell/joelang/releases
TIP
When downloading a binary file, you can rename it to
joec
which is what code snippets in the documentation use.Or clone the repo, then
npm i
to install dependencies.TIP
When cloning and running locally,
joec
in the code snippets can be replaced withnpm run joec
or./.bin/joec
Usage
Compile a .joe
file
bash
joec main.joe # compile
./main # run
Read from stdin
Reading input from stdin will compile and run your code without saving a binary file to disk.
bash
joec -i 'f main { print 42 }'
Advanced Usage
Advanced usage is available behind flags.
bash
# debug mode on
joec [filename].joe -d
joec -i '...' -d
# stop after lexing, do not parse; will output the Tokens
# (that's the lowercase L, not the number 1)
joec ... -l
# stop after parsing, do not analyze; will output the Parse Tree
joec ... -p
# stop after analysis; do not compile; will output the AST and Symbol Table
joec ... -a [--json]
# run the tests
npm test
TIP
When running Joelang with npm run joec
, remember to separate the flags with --
.
npm run joec [filename.joe] -- <flags>
Included Examples
See the examples directory