Julia for microcontrollers (like Micropython)

proposal

#1

Dear Julia community members,

I wish to develop a fork of Julia that can run on low memory low ram microcontrollers .

Similar to Micropython (python for microcontrollers)

Micropython website

I’m working on low cost wifi module ESP8266 with micropython.

I’m working on developing RTOS for Internet of things.

Kindly shed some light on my path to reach my goal…


FYI: 16-bit support in LLVM; any idea if easy to support it/8-bit micros/MCUs in Julia?
#2

Welcome! I’m not sure how to help you, but I suspect you will have better luck with others if you follow some of these suggestions with your question.

The project you describe sounds like a big one, and when you just ask “what path should I take?” I’m guessing it’s a bit too vague, and very few people will have any sense of how to help you. Maybe tell us what you’ve done already, and what problems you’ve encountered that you need help solving.


#3

This is a great idea! I’ve been hoping one of the chip manufacturers would pick up on how great Julia is and integrate it themselves. I saw that the university of Malta is working on an LLVM for the 16 bit MSP430, so you might get some information there.
This does sound like a monumental task, and I can’t wait to see you succeed!


#4

In theory something like Micropython could be replicated for Julia, (while it would be even more work for e.g. that MCU; I wasn’t even sure MicroPython supported any non-ARM ones). ARM (or x86) MCU would be the best bet.

Since you can call Python with PyCall.jl, or should I say, call Julia from Pyhon using PyJulia package (that’s based on PyCall.jl), it might be helpful to look into if PyJulia would work with MicroPython. It likely doesn’t because MicroPython is baremetal non-standard variant. Julia however requires an OS (currently at least) and a filesystem. I’m not sure you have any filesystem [access] with MicroPython. MicroPython also has changed garbage collection from regular Python. That it supports real-time use is interesting (and I recall based on fixed amount of memory and knowing the exact hardware/size). Getting the same GC guarantees with Julia should be possible, but I wouldn’t rely on it happening just by change.

Julia would not work directly on ESP8266 given that it uses “L106 32-bit RISC microprocessor core based on the Tensilica Xtensa”; and neither for any 16-bit despite it working on an LLVM:

E.g. even with 8/16-bit AVR having LLVM support (and working with Rust language, or getting there), that CPU, or any non-32-bit (or 64-bit), such as MSP430, will not work with Julia (see my thread in it; ans answers on how difficult and unlikely adding 26-bit support is; long term I see 8- and 16-bit CPUs as dead anyway, and would concentrate on ARM).

Only possibly workaround might be Julia2C (see other microcontroller thread where I wrote about that).