Monday, March 28, 2016

"A Genuinely Nice Chap": Community Service Award Recipient Damien George

"We wouldn't have Python on the micro:bit if he hadn't made it work, to put it simply," Nicholas Tollervey says. He's talking about Damien George, the physicist and engineer behind MicroPython, the Python interpreter for microcontrollers.

George began his project to build a Python interpreter for microcontrollers in 2013. "I started writing MicroPython to see if it's possible," he says. "Could I shrink Python down small enough to run on these tiny chips?" From scratch, he made a Python compiler so skinny it could squeeze into 128 kilobytes of RAM, and then wrote the runtime and built-in functions. "After about 6 months I realized it was possible, and I had a proof of concept."

Damien George, PSF Community Service Award recipient
Surprisingly, MicroPython is based not on the CPython code, but on the documentation. "I tried to look as little as possible at CPython's implementation," he says. "I'd say 95% of the Python language is specified in the docs, maybe even more."

George launched the MicroPython campaign on Kickstarter at the end of 2013, and raised nearly £100,000. With the support of donors and the efforts of volunteers, he released MicroPython along with a small computer, the PyBoard, which packs a processor, RAM, LEDs, and an accelerometer into a package less than two inches square.

The MicroPython PyBoard
The BBC, meanwhile, wanted to port Python to its own little computer, the micro:bit. They partnered with the Python Software Foundation and worked with Tollervey, a PSF fellow, to obtain a Python interpreter for their secret project. That effort fell through in April 2015, leaving Tollervey anxious that Python would be left out of the micro:bit launch. Young coders can program the micro:bit with another tool, Microsoft's TouchDevelop, but Tollervey says that Python on the micro:bit provides a special opportunity: "The important thing about Python is continuity. Kids can pick up Python because it's easy to learn, and it's also the same language you use at the workplace. These are skills they can use in the future."

By chance, in a discussion over tea with an engineer from ARM, Tollervey realized MicroPython might work on the micro:bit. He sent a prototype of the board to George with a note stuck to it: "I want this back, Damien," and a smiley face. Within a week of getting the prototype, George had MicroPython running on it. Tollervey says, "When we had that I knew we were on to a goer." He did eventually get his board back.

The Python Software Foundation awarded Damien George a Community Service Award in 2016. In addition to his extensive volunteer work on the BBC micro:bit and MicroPython, George spent time answering questions, helping users, and reviewing code from the wider MicroPython and micro:bit communities. Tollervey adds, "He's a very good mentor, and just a genuinely nice chap."

Now that the micro:bit is launched, MicroPython is gaining a far wider audience. Last Tuesday the BBC began delivering micro:bits to a million school children. George says, "It's a relief that it's finally out there, and very exciting to see this new era of kids using Python on these little devices."

The BBC micro:bit

Tuesday, March 22, 2016

A Million Children

Today, March 22nd, the British Broadcasting Corporation (BBC) begin to deliver 1 million small programmable devices to the UK's 11 and 12 year old children. The aim is to inspire a new generation of digital creators. The device is called a BBC micro:bit and, among other things, it runs MicroPython.

The device is about the size of a credit card, comes in different colours and consists of a couple of buttons, a 5x5 LED matrix, I/O pins, an accelerometer, compass, ARM processor, micro-USB port, battery connector and BLE. Over the coming weeks all the software and hardware plans needed to recreate the project will be released under an open license. If you have the time and money, you could fork this work and make your own.

Since the project's inception, the Python Software Foundation has been a member of the partnership tasked to deliver this "moonshot". The partnership consists of almost 30 organisations including big multi-nationals such as ARM, Microsoft and Samsung, academic institutions like Lancaster University and volunteer and community based organisations such as the PSF and CodeClub.

Originally, the PSF agreed to provide Pythonic educational resources and expertise. The BBC told us they already had a Python solution in the pipeline. However, at the beginning of May the partner who was to deliver this solution dropped out and we were asked to provide an alternative.

Thanks to Damien George's amazing MicroPython project and his collaboration with an international community of Pythonistas the device runs a full re-implementation of Python 3. The version of MicroPython on the micro:bit doesn't include the standard library. However, it contains several easy to use modules for interacting with the device's hardware, making music, digital art and connecting stuff to the device via its I/O pins. All the standard language features are supported including data types, OOP, data structures, exceptions, generators and builtins. All this on a device with 256k of flash memory and 16k of RAM.

Special mention should be made of Mark Shannon who did amazing work on the display related capabilities of MicroPython on the BBC micro:bit. Mark also has interesting work-in-progress on improved audio capabilities.

Members of the community have been busy generating more than just code. Between them they have created:

We're incredibly proud that all the Python related work was created by volunteers in their spare time: community minded Pythonistas with a passion for education who want to inspire digital creativity in young people. It's yet more evidence that Python has the world's greatest programming community. A big "thank you" to everyone who contributed.

Why is this so important?

Asking what sort of education and learning our community supports is how we decide what sort of community we become. For it is through education and learning that we engage with our future colleagues, friends and supporters. Put simply, we're investing time and effort in the future of a diverse Python community.

You're probably wondering what you can do with the device. A quick look around the world-tour website will show you how MicroPython on the micro:bit can be adapted to a huge number of educational (and not so educational) uses. Two of our favourites are described below:

Radomir Dopieralski only had his device a few days before he'd managed to fry it while connecting it to a robot. Failure is an essential aspect of education - it's how we learn to adjust and improve our behaviour while exploring the world around us. Happily, Radomir learned from his mistake and went on to build several different robots including our favourite called "Bob" (which is wobbly-cute in a menacing "all humans must die" sort of a way):

Martin O'Hanlon is a regular contributor to the education track at PyCon UK. His lessons in programming Minecraft with Python are genius-level performances that end with a hundred kids and their parents furiously hacking Python so Minecraft does crazy things. It's inspiring to see such a thing unfold. As a result, we were especially looking forward to his contribution (and he didn't disappoint).

Mart has managed to tick pretty much all the boxes for many 11 year olds with his X-Wing flying in Minecraft running on a Raspberry Pi controlled via MicroPython running on a BBC micro:bit. Perhaps the only thing missing is that it doesn't come with a side of pizza and fries:

Finally, if you're wondering what it feels like to program such a device... the following reaction is typical:

You'll soon be able to get your own via mail-order when they're released to the general public over the summer.

If you're interested in contributing (there is so much yet to be done) then join our mailing list or check out our source code. We accept contributions, without prejudice, from anyone. If you're thinking, "but not me", then we especially mean you. Good quality content and engagement with respect, humour and intelligence wins every time.

Our children's latent talent, joie de vivre and receptiveness to programming in Python is something unambiguously good for us to support, cherish and foster. MicroPython on the BBC micro:bit is one way to do this.

Come join in the fun!