3 ms·
Great so now in order to create a performant embedded app i need to write everything in two languages. We should make Rust compile to Arduino and other embedde
by zackees 6y ago
Great so now in order to create a performant embedded app i need to write everything in two languages.
We should make Rust compile to Arduino and other embedded devices and be done with it.
- embedpythony 6y agoIt already does! (As long as the target supports LLVM) https://rust-embedded.github.io/book/ https://rust-embedded.github.io/book/
- mlyle 6y agoThere'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.
- neilpanchal 6y agoExactly. 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!
- mkesper 6y agoWhich boards are you using and how did you chose them?
- mlyle 6y agoI 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 https://www.adafruit.com/product/3333 and was really happy with it... but I wanted something a little beefier and to have wireless options.
- matt_trentini 6y agoGenerally 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.