Build for Pinnacle
Write your app in Rust or in Frits, draw it with Vulkan or wgpu, and offer it in the Store.
Your Rust program, built for Pinnacle
Pinnacle has its own target in Rust, aarch64-unknown-pinnacle, with the standard library:
threads, files, the network and processes work as they do elsewhere.
- Common crates run: tokio, winit, wgpu and Bevy have Pinnacle support.
- 3D on the graphics card through Pinnacle's own Vulkan driver; wgpu programs run unchanged.
- Cartopolis, a whole 3D city built with Bevy, runs on Pinnacle and is in the Store.
# the system, its apps and Rust's std for Pinnacle
git clone https://code.garage44.eu/jeroen/pinnacle.git
cd pinnacle
cargo xtask run
# a wgpu program, drawing in a window on Pinnacle
cargo xtask wgpu-demo
Frits: scripts that can only do what they say
Frits is Pinnacle's scripting language. The first line of a script lists what it may use. In this example, a script for an object on a map, that is the object itself, the chat and a timer, so the script cannot touch your files or the network: the compiler refuses the code before it ever runs.
- Small: a waiting script takes less than 1 KB of memory, so thousands can run at once.
- It cannot freeze your device: a script that runs too long is paused and continues later.
- Passwords stay hidden: a script can pass a secret on, but never read it.
- Tools included:
frits run,frits test,frits fmtand completion in your editor.
Today Frits runs as a program of its own on Linux and macOS. Pinnacle's apps and Cartopolis's scripts move to it next. Frits's source
// what this script may use: nothing else works
script / Prim, Chat, Timer
enum State { Patrol, Summoned }
var state = Patrol
on timer() {
match state {
Patrol => Prim.set_geo({ lat: 53.2194, lng: 6.5665 }),
Summoned => Chat.say("On my way."),
}
}
// someone tapped it
on touch(id: Int, name: Str) {
state = Summoned
}
Interfaces with Mithril
Pinnacle's screens are written with Mithril, a Rust library for interfaces that also draws web pages.
- Layout from the window's size, so one app fits a phone and a desktop.
- Only what changed is drawn again, and only that part goes to the screen.
Today About is built with it; Settings and the other apps follow. Mithril's source
Offer your app in the Store
A store is a folder of plain files on any web server. Anyone can run one.
Package
List your app's files and the rights it needs: the internet, the graphics card, or none.
Sign
Sign the package with your Ed25519 key.
Serve
Put the catalog, the package and the files on a web server.
Install
A Pinnacle that lists your address and trusts your key shows your app in its Store.
catalog one line per app: name|title|version|size|description|rights
packages/<name>.ppk the app's package, signed
blobs/<sha256> the app's files, named by their SHA-256
The format in full: docs/store.md