Live data from Hacker News

MicroPython – Python for Microcontrollers

micropython.org

1–10 of 106 posts

Re: MicroPython – Python for Microcontrollers

#2
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 than the C equivalent code, but it’s also still missing a lot of API’s and fine grained control, at least for the ESP32. For instance, what finally made me switch to the ESP-IDF was complete lack of support for ADC2 on ESP32 in Micropython. Having to recompile the Micropython firmware to change a good chunk of the configuration parameters was also annoying because it takes a decent amount of time to compile and reflash firmware.

Bottom line is that Micropython is a great project for certain things - some home automation and simple sensors. On things where performance doesn’t matter or isn’t bottlenecked by the Python interpreter (like simple HTTP communication) it’s great. It also has a surprisingly robust open source driver ecosystem, provided you aren’t trying to do anything fancy with SPI.

It falls apart when you need to work with it professionally though. So use it to build and test your product, but rewrite it in C/C++ when it gets closer to ship time.

Re: MicroPython – Python for Microcontrollers

#4
Related:

MicroPython - https://news.ycombinator.com/item?id=24166861 - Aug 2020 (147 comments)

MicroPython and the European Space Agency - https://news.ycombinator.com/item?id=9699798 - June 2015 (28 comments)

MicroPython: Python for microcontrollers - https://news.ycombinator.com/item?id=9558969 - May 2015 (19 comments)

MicroPython – Python for microcontroller - https://news.ycombinator.com/item?id=8177695 - Aug 2014 (17 comments)

Re: MicroPython – Python for Microcontrollers

#5

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…

I had a similar experience, however the “native” and “viper” code emitters do a very good job of allowing you to optimise performance bottlenecks. It’s a lot like Cython.

https://docs.micropython.org/en/kookaberry/reference/speed_p...

https://docs.micropython.org/en/kookaberry/reference/speed_p...

Re: MicroPython – Python for Microcontrollers

#10

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/

That looks really interesting. Swift is - in my opinion - probably the best language out there. If wish it would get more traction on server side and on Linux too.
Post reply on HN