Categories
Computing

Yarg 0.1.0

I’ve made a release of Yarg, as version 0.1.0 on GitHub. You could use this to replicate the ‘hello_led’ and ‘hello_button’ examples I published earlier. Please do let me know if you try it out!

Categories
Computing

hello_led; hello_button

I’ve spent the last couple of days writing software in Yarg. Whilst it’s not the first such code, I think it is the first where it looks like the code I envisioned when I started.

hello_led (source code) now demonstrates turning on the built in LED of a Raspberry Pi Pico, via a set of three writes to the registers controlling the GPIO peripherals. These are declared with names recognisable from the data sheets for the board, and the whole example can be typed at the REPL.

hello_button (source code) builds on my earlier work with interrupts, to demonstrate a complete program that initialises some peripherals (the LED & button), and then goes into a loop where the Pico’s microcontroller is idle until a button is pressed. This marks the use of the earliest multiprocessing language additions alongside peripherals for the first time. These are a pair of primitives: ‘channels’ (similar to those in go) and ‘routines’ (coroutines, similar to go coroutines, or Lua coroutines).

These examples are both maintained in the specimen collection, and shared in the README for the yarg-lang repo.