Jetmonk's Common Lisp Interface Puts the Raspberry Pi's GPIO Header Under Your Control

Open source interface sits between your Common Lisp programs and the pigpio library to provide full hardware control at your fingertips.

Gareth Halfacree
2 years agoHW101

Pseudonymous developer "jetmonk" has put together a treat for anyone who prefers to do their embedded programming in Lisp: an interface between Common Lisp and the pigpio library for the Raspberry Pi's general-purpose input/output (GPIO) header.

"I prefer Common Lisp to Python (speed, elegance, stability)," jetmonk explains of the reasoning behind the project, "and I have big personal libraries of Lisp, so I decided to port pigpio to Lisp. It allows you to switch between hardware (ligpigpio.so) and daemon (libpigpiod_if2.so)."

The interface allows developers to write programs interfacing with hardware connected to the Raspberry Pi's GPIO header in Common Lisp, a programming language standardized in 1984 and selected a decade later as the official ANSI flavor of a language family which dates back to John McCarthy's work in 1960 — making it the second-oldest high-level language still in active use, behind 1957's Fortran.

"Generally, the best Lisp version for Pi seems to be 64-bit SBCL [Steel Bank Common Lisp], because 32-bit SBCL doesn't have threads, and 32-bit CCL [Clozure Common Lisp] threads crash on multiple cores," jetmonk writes. "But that's fine, because SBCL is my Lisp of choice elsewhere too."

Jetmonk's interface is available on GitHub under the permissive MIT license; the developer notes a couple of caveats to its use, including a lack of support for the new Raspberry Pi 5. More information is available in jetmonk's Reddit post.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles