Skip to content
hkretePublic
forked from matteopolak/jacket

About

Independent Jai toolchain: compiler, language server, formatter and linter

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

1,276 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jai{c,lsp,fmt,lint}

Compiler checks

An independent toolchain for the Jai programming language:

  • jaic, a compiler that type-checks, interprets and natively builds real Jai programs and libraries, with its own standard library;
  • jailsp, a language server;
  • jaifmt, a formatter;
  • jailint, a linter.

It is written from public documentation and third-party Jai code, without access to the official compiler or its modules. It builds native executables for macOS, Linux and Windows (x86-64 and arm64) and WebAssembly, and real projects such as the Focus editor compile and run.

Try it in the browser →

Install

Each install includes jaic, jailsp, jailint, jaifmt and the standard library.

brew install matteopolak/tap/jai               # macOS, Linux
winget install matteopolak.jai                 # Windows
nix profile install github:matteopolak/jai     # Nix
curl -fsSL https://raw.githubusercontent.com/matteopolak/jai/main/install.sh | sh

The last line is the install script for macOS and Linux. There are also a PowerShell script, prebuilt archives, a GitHub Action and build-from-source steps.

Usage

Node :: struct(T: Type) {
    next: *Node(T);
    value: T = 19;
}

answer :: () -> int { return 23; }

main :: () -> int {
    node: Node(int);
    return node.value + #run answer(); // Exit status: 42
}
jaic check examples/compile-time-record.jai        # type-check only
jaic run examples/compile-time-record.jai          # run in the interpreter
jaic build examples/compile-time-record.jai -O2    # native executable (-os windows to cross-build)
jaic check broken.jai --color always               # force coloured errors (or NO_COLOR=1 to turn them off)
jaic run examples/tour/main.jai                    # the language tour the playground opens with
jailint src/                                       # lint every .jai file under src/
jailint src/ --fix                                 # apply the safe fixes

Editors

  • VS Code and Open VSX editors: the Jai extension (docs).
  • Neovim 0.11+: jai.nvim (language server, formatter, linter, toolchain download).
  • Anything else: run jailsp as a language server over stdio (language server).

Documentation

Contributing

Pull requests are not accepted. Bug reports and feature requests are welcome as issues; see CONTRIBUTING.md.

License

AGPL-3.0-or-later, with a runtime library exception: programs you compile are yours to license however you like. See docs/license.md.

About

Independent Jai toolchain: compiler, language server, formatter and linter

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages