Omer Kilic (twitter)is now a PhD student at the University of Kent; I had the pleasure of working with him while I was there doing my degree a few years back. (In fact, Omer’s excitement about embedded systems is part of the reason why I finally got over my own fears about real hardware and started playing with small systems like the Arduino.) Adam Sampson has hooked him up with our nascent Plumbing library for the Arduino, and he has some tasty-tasty blinkenlights going on:
Parallel Blinkenlights! from Omer Kilic on Vimeo.
I’ll try to get a website and some getting started information up on the web in the near future. Plumbing is a library for handling input and output on the Arduino in a parallel-safe way, using the occam-pi programming language. The code for the above example probably looks something like this:
PROC main ()
PAR
blink (13, 500)
blink (10, 400)
blink (7, 600)
blink (4, 300)
:
How do you do that?
For a number of years, we’ve been working with a language that is fundamentally parallel in nature. More importantly, the Transterpreter was at the core of Christian Jacobsen‘s doctoral work. The Transterpreter (other than having a really cool name) make it possible to run occam-pi programs on really tiny devices. The Arduino is an example of what I mean by a “tiny” device.
While I don’t know exactly how fast Omer is blinking the lights, I know he is blinking them in parallel. This means that they are blinking at the same time. When programming in occam-pi, you pretend that it is possible to do things simultaneously by writing PAR, and then you let the tools take care of everything else for you. I only say “pretend” because the Arduino only has one processor—but, despite this, we write PARallel code in occam-pi and let the tools take care of things, regardless of whether we have one processor or one thousand.
As a result, blinking four LEDs is one of the easiest things in the world to do. As you can see, Omer is blinking four pins at different rates of speed, all underneath one PAR block.
Open-source is Awesome
Everything we work on is open source (GPL/LGPL), and we have the first few chapters of a book drafted to support people learning with these tools. We’ve aimed the book at artists and (people are assuming are) non-programmers. That doesn’t mean we’re talking down—it just means we’re writing lots of tiny chapters that expose just one thing at a time. I’ll work on getting some minimal website up for the materials, get some mailing lists set up, and see if we can’t get a few people playing with the fun stuff. I wasn’t planning on releasing things this soon, but it looks like we’re starting to see a bit of interest. That must mean… it’s time to release!
You see, right now I’m out in Raleigh, NC taking part in POSSE (Professors’ Open Source Software Experience), which is graciously being hosted by Red Hat through the auspices of gdk. As Dr. Panic points out in his blog post about packaging software, I chose to do something other than “Hello, World” yesterday. I decided I’d try and get all the tools we need for the Arduino packaged up as a Red Hat package, so RH users could download things and dive in. That took a long time, and I’m not done yet… but I’m making good progress! Sadly, I can’t run myself under a PAR block… I’d be able to get so much more done…
We’ll get stuff online, and others can join in the fun. That can be part of tonight’s homework… along with everything else the POSSE organizers have us doing.