Blinking An Arduino LED, In Julia

The Julia programming language is a horrible match for a no-frills microcontroller just like the ATMega328p that lies inside the traditional Arduino, however that didn’t cease [Sukera] from attempting, and succeeding.

All the options that make Julia a cool programming language on your large laptop make it an terrible alternative for the Arduino. It’s designed for interactivity, is dynamically typed, and leans closely on its rubbish assortment; every of those options alone would tax the Mega to the breaking level. However in its favor, it’s a compiled language that’s based mostly on LLVM, and LLVM has an AVR backend for C. Ought to simply be a easy matter of stubbing out a few of the overhead, recompiling LLVM so as to add an AVR goal for Julia, after which fixing up all the opposite unfastened ends, proper?

Properly, it seems it nearly was. Leaning closely on the pliability of LLVM, [Sukera] manages to show off all of the language options that aren’t wanted, and after some small hurdles like the same old issues with unstable and atomic variables, manages to blink an LED slowly. Huzzah. We love [Sukera’s] wry “Now THAT is what I name two days effectively spent!” after it’s all executed, however critically, that is the primary time we’ve each seen even super-rudimentary Julia code operating on an 8-bit microcontroller, so there are undoubtedly some kudos due right here.

By the point that Julia is wedged into the AVR, a whole lot of what makes it interesting on the large computer systems is lacking on the micro, so we don’t actually see folks choosing it over straight C, which has a way more developed ecosystem. However nonetheless, it’s nice to see what it takes to get a language designed round a runtime and rubbish assortment up and operating on our favourite mini micro.

Thanks [Joel] for the tip!

Leave a Comment