There's a real advantage to having an interpreter.
Write your low-level/high performance code in whatever. Then write top-level logic-- and let your users script in-- micropython.
I'm teaching a middle school class this year with micropython on embedded. I can't fit Rust in with everything else I'm teaching in one trimester. I've even written an IDE which runs in the browser (on chromebook, etc) so there's no external dependencies for them.
Re:MicroPython
by neilpanchal on Sunday August 16, 2020 @08:28PM
(#24182603)
Exactly. All high level logic (no loops, massive arrays, and heavy arithmetic) can be written in Python. Overhead for C binding calls is minimal. The downsides related to undetectable slowless exceeds the utility and ease of development. Not to mention, over the air `upip` installs! If you have an ESP32/8266 or any wifi enabled chip, you can call:
upip install foo
at runtime!Which boards are you using and how did you chose them?
I designed a little board that shims under a standard ESP32 module and has capacitive touch, a couple channels of motor driving, MEMs gyros, and LEDs. I was able to get things to $5/unit at qty 50 (counting ESP32) this way and to get exactly what I needed.
My brother taught a robotics team where he used https://www.adafruit.com/product/3333 and was really happy with it... but I wanted something a little beefier and to have wireless options.
Re:MicroPython
by embedpythony on Sunday August 16, 2020 @03:38PM
(#24180566)
It already does! (As long as the target supports LLVM)
Re:MicroPython
by matt_trentini on Sunday August 16, 2020 @09:19PM
(#24182875)
Generally the tactic is to write everything in MicroPython and, only if performance requires it, drop into C to write small sections.
It's still significantly faster than developing wholly in C - or Rust for that matter. And that's if writing in a low level language is required at all.
We should make Rust compile to Arduino and other embedded devices and be done with it.