Live data from Hacker News

MicroPython – Python for Microcontrollers

micropython.org

21–30 of 106 posts

Re: MicroPython – Python for Microcontrollers

#21

Another alternative is rust. https://github.com/rust-embedded/awesome-embedded-rust I intend to have a try of both rust and tinygo. Micropython is only ok on an esp32 with psram.

I think rust is the way to go, it provides granular control if needed and strong type annotations and the borrow features. however, C is here to stay for an eternity.

Re: MicroPython – Python for Microcontrollers

#23
Interesting to note that MicroPython can also output MIDI, like QMK but, in my experience, much easier to work with. I got a little 4x4 micropython numpad and turned it into a midi controller.

Been trying to find a 40%-ish keyboard with micropython so I can do the same with that, but no luck so far other than DIY jobs

Edit: Apologies, was thinking of CircuitPython, which it turns out is a fork of Micro Python. Not sure if micro can also output midi

Re: MicroPython – Python for Microcontrollers

#24

I did a lot of product development using Micropython over the past year or so. There are certain things it is very good at - one is rapid prototyping. For instance it’s a lot easier and faster and less verbose to quickly get some http server communication going on the ESP32 in Micropython rather than the C equivalent. The downsides are somewhat dramatic though - it’s, of course, a lot slower and hungrier for memory t…

One thing to add from my experiences: it's dramatically more accessible to beginners than Arduino and way more useful for building one-offs/prototypes as well.

Re: MicroPython – Python for Microcontrollers

#25
Another alternative is Toit: https://toitlang.org

I recently wrote a Toit version of the lessons for the MakePython ESP32 starter kit. That makes it easier to start with Toit, but it also gives a nice comparison between the two.

MicroPython: https://www.makerfabs.com/desfile/files/Get-Started-MicroPyt...

Toit: https://docs.google.com/document/d/1K-TYea7jbYfj2ecMUmr0T0zd...

Re: MicroPython – Python for Microcontrollers

#26
post #16

A possible alternative to MicroPython is Nim - it's a strongly typed language with Python-like syntax that compiles down to C. Since it compiles to C, it can use existing C libraries without much fuss (just wrap signatures as needed), plus there's no need for a "micro" version of the language. Several members of the community have been working on improving the embedded ecosystem: although I haven't played around with…

I've been using Nim and Nesper for the firmware of a device I'm making, it's been mostly great. Nim's C interop is painless, anything Nesper hasn't already wrapped can generally be pulled in from the official C libraries in one shell command. My only headache with Nim on the ESP32 is that the official framework doesn't provide a full POSIX implementation so some stdlib functions don't work.

https://github.com/khogeland/pxed/

Re: MicroPython – Python for Microcontrollers

#29
post #19

I find reading untyped code unnecessarily difficult. Just this week I came across Swift for Arduino, and SwiftIO, both Swift language solutions for low level boards. I'm looking forward to giving them a spin. https://www.swiftforarduino.com https://www.madmachine.io/

Does micropython not allow typing? That would be odd. I mean, i see how running it with mypy on an esp32 does not work, but the hints can be evaluated on the dev-platform and used by the developer and his IDE/Linter/whatever.

It allows typing as you'd expect.

Edit: More specifically, the parser correctly ignores type hints.

Re: MicroPython – Python for Microcontrollers

#30

I did a lot of product development using Micropython over the past year or so. There are certain things it is very good at - one is rapid prototyping. For instance it’s a lot easier and faster and less verbose to quickly get some http server communication going on the ESP32 in Micropython rather than the C equivalent. The downsides are somewhat dramatic though - it’s, of course, a lot slower and hungrier for memory t…

> It falls apart when you need to work with it professionally though

More accurately: it falls apart when you need it professionally :) Totally depends on the usecase.

Post reply on HN