Snek: A Python-inspired Language for Embedded Devices

Snek is a tiny embeddable language targeting processors with only a few kB of flash and ram. Think of something that would have been running BASIC years ago and you'll have the idea. These processors are too small to run MicroPython.

Snek borrows semantics and syntax from python, but only provides a tiny subset of that large language. The goal is to have Snek programs able to run in a full Python (version 3) implementation so that any knowledge gained in learning Snek will transfer directly to learning Python.

Current Status

Snek version 1.8 has been released.

  • Add 'str' builtin. Just like Python, the str builtin converts any value to a string.

  • Fix 'chained' comparisons (e.g. a < b < c). These generated incorrect code that left the stack messed up unless all comparisons were true.

  • Allow 3 * 'a' as well as 'a' * 3. The code for evaluating expressions only permitted the string to be on the left side.

  • Add support in snekde for auto-detecting device baud rate between 57600 and 115200 baud.

  • Add port to the ATMega 328 based LilyPad, in both the regular size as well as the big version which replaces the boot loader to gain more functionality.


I've got Snek packaged for generic Linux, Mac OS X and Windows machines. All three packages include a snek binary for the host operating system to experiment with, binaries for target devices, snekde (the Snek Development Environment) and documentation.

Packages are available in the dist directory here

Debian Packages

Snek is available in Debian unstable. If you're running Debian stable (version 10, aka “Buster”), Snek can be installed from my personal package archive. Instructions on how to set that up for your machine are available in the README in that directory.

There are two snek packages:

  • snek. The main 'snek' package includes source code for use in your own embedded environment, a binary for all supported boards, the 'snekde' development environment and documentation.

  • snek-bin. The auxiliary 'snek-bin' package includes a 'snek' application compiled for the host machine, which can be useful to experiment with language features and functions that do not require access to the target hardware.

Mu Editor

Mu is a great development environment for new Snek programmers. Read more about Mu and Snek here


Snekboard is a custom embedded computer designed to run Snek or CircuitPython. The Crowd Supply Campaign for Snekboard finished a few weeks ago. Soon you'll be able to order boards for immediate sale from that page.

Snek and Lego

Snek and Lego make a great combination. Read about how to use them together here


All of the documentation included in the snek distribution is linked from the Documentation page.

I started documenting snek in my blog, here is a link to all snek-related blog posts.

There is also a Snek mailing list, which you are encouraged to subscribe to

Source Code

You can find Snek in either my git repository or github

Snek is licensed under the GPLv3 (or later)

Snek in NuttX

NuttX is a moderate-sized embedded RTOS that works on a variety of small systems. I've written the necessary glue-code and build instructions to make Snek available there. All of that code is licensed under the standard NuttX/BSD license, but because NuttX upstream is not willing to take code that references GPL code, I've created a fork of the NuttX app tree in my git repository..

NuttX has a good mechanism for adding code of this sort; there are no changes to existing NuttX files, just a new directory in app/interpreters/snek. When present, all of the necessary options become visible in the regular NuttX configuration tool.

This port doesn't interface to much of NuttX yet, it would be fun to see some experimentation here.