Skip to content
On this page

Get Started

Quick Start

  1. Install requirements

    Requirements

    To compile a joelang program, you'll need

    RequirementVersionVerify via
    Node.js & NPM18.xnode -v and npm -v
    clang3.26.4clang --version
    llvm14.0.6llvm-config --version or llvm-config-14 --version
    gcc12.2.0gcc --version
    bash
    curl -sL https://deb.nodesource.com/setup_18.x | sudo bash
    sudo apt install -y nodejs clang llvm-14 gcc
    
    bash
    brew 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 with npm 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