An Arduino LED is burning in Julia

Julia is a terrific fit for no-frills microcontrollers like the programming language ATMega328p in the classic Arduino, but it didn’t stop there. [Sukera] Try, and succeed.

All the features that make Julia a great programming language for your big computer make it a terrific choice for Arduino. It is designed for interactivity, typed dynamically, and leans too much on its garbage collection; Each of these features alone will tax the mega at the breaking point. But for that, it is a compiled language based on LLVM, and LLVM has an AVR backend for C. Just omit some of the overhead, rearrange the LLVM to add an AVR target for Julia, and then fix all the other loose edges, right?

Well, it turns out it was almost. Leaning heavily on the flexibility of LLVM, [Sukera] Manages to turn off all language features that are not needed and manages to slowly blink an LED, after some minor interruptions such as common problems with volatile and atomic variables. Hujjah. We love [Sukera’s] wry “Now whoever I tell has had a good two days!” After all, but seriously, this is the first time we’ve all seen super-rudimentary Julia code running on an 8-bit microcontroller, so there’s definitely some compliment.

When Julia joins the AVR, much of what makes it attractive on large computers is missing in the micro, so we don’t really see people picking it straight on C, which has a much more advanced ecosystem. But even then, it’s great to see what it takes to create and run a language for runtime and garbage collection on our favorite mini micro.

Thanks [Joel] For the tip!

Leave a Reply

Your email address will not be published.