Tutorials
Each one is a whole program that runs on a real board.
Before the first one
You need three things, and the first tutorial assumes you have them.
IntelliJ IDEA 2025.2 or newer, Community or Ultimate — Nylon works the same in both.
The Nylon plugin, which gives you the language, the board list and the run button. It is not published yet; it goes to the JetBrains Marketplace with V0.
A board with a card image on it. The image is the whole system — there is no operating system under it. Images are published per board and are not up yet either.
So nothing is downloadable today. Download carries the detail and will carry the links the moment they exist, and Boards says what runs now.
Start here
Blink — the board's status LED, on and off. The shortest program that proves your board, your network and your plugin all work.
Hello — text back from the board, over the serial line and into IntelliJ's run window.
Go further
Keys — read a USB keyboard attached to the board.
Bots — drive LEGO Technic motors through the Raspberry Pi Build HAT.
Joyride — a DualShock 4 gamepad drives two motors, one per stick. The home page shows its entrypoint; this is the whole program.
# Joyride: a DualShock 4 drives the Build HAT's two motors, one per stick.
namespace joyride
import grandtheorem.rpi.Pi
import grandtheorem.rpi.DualShock4
import grandtheorem.devices.Gamepad
import grandtheorem.buildhat.BuildHat
import grandtheorem.buildhat.Motor
# A stick's position in twentieths, or OFF once stopped.
let OFF: i32 = 99
let level(speed: f32): i32 = i32(speed * f32(20))
class Wheels {
let left: Motor
let right: Motor
var leftLevel: i32 = 99
var rightLevel: i32 = 99
new(l: Motor, r: Motor) {
left = l
right = r
}
# One turn of the loop. With a state, the sticks drive the motors as they read; with
# none - no pad, or none newer within the timeout - both stop. A motor is sent a speed
# only when its level changes, so a pad reporting fast doesn't fill the HAT's serial line.
let drive(pad: Gamepad): boolean {
if (let state? = pad.read(100.milliseconds())) {
let l = level(state.leftY)
if (l != leftLevel) {
left.start(f32(l) / f32(20))
leftLevel = l
}
let r = level(state.rightY)
if (r != rightLevel) {
right.start(f32(r) / f32(20))
rightLevel = r
}
return true
}
if (leftLevel != OFF) {
left.stop()
leftLevel = OFF
}
if (rightLevel != OFF) {
right.stop()
rightLevel = OFF
}
# With no pad a read answers at once: wait as a timed-out read would, so the loop
# doesn't spin.
sleep(100.milliseconds())
return false
}
}
entrypoint.default joyride() {
let hat = BuildHat(Pi)
let wheels = Wheels(hat.motor(0), hat.motor(1))
let pad = DualShock4()
while (true) {
wheels.drive(pad)
}
}
Let go of the sticks before you press Stop: a motor that is turning keeps turning after the run ends.
Sharing your code
How to share a program or a library: as a git repository, or published as a .nylib that another build fetches by
its coordinate.
Coming soon
These are V1's, not V0's, and they are not here yet.
⚠ Kestrel — real-time drone flight control. A flight controller written in Nylon, with the hard real-time guarantees that a drone's control loop needs.
⚠ Cluster computing. One program across several boards.
The tutorials themselves are being written now. Until they land, the Docs cover the language itself.