This repo serves as an example project for writing Nintendo Switch homebrew in Jai. The LLVM backend is used to target the machine, and a few hacks to Jai's built-in modules are needed to get basic support working somewhat decently since ARM64 is not yet a first-class target.
Included also are bindings for the following libraries:
Ensure you have devkitPro installed. This should set the DEVKITPRO
environment variable to its install location.
I recommend storing Jon's Jai beta releases in a Git repo. You can then make a new branch just for working with the module hacks you'll need to install. From there, in the root of the Jai release folder, do:
git apply --ignore-whitespace /path/to/this/repo/jai-module-hacks.patch
These hacks in this repo are up to date for Jai version 0.1.089.
jai first.jai - target
If you leave off - target
, it will build the program for your host machine. The idea is that perhaps you want your project to be able to target Switch primarily but also your host PC during development.
- Complete bindings for inline functions / macros in libnx
- Make bindings more idiomatic where applicable
- @ctp and @ctpeepee in the Discord server for helping with the module hacks
- DevkitPro
- The developers of libnx
- Jonathan Blow and the rest of the Jai language team