If curious see also 2014 https://news.ycombinator.com/item?id=7840566 also 2014 https://news.ycombinator.com/item?id=6996692 2015 https://news.ycombinator.com/item?id=9558969 2016 https://news.ycombinator.com/item?id=11181158 Many submissions but those seem to be the interesting threads.
MicroPython
41–50 of 152 posts
Re: MicroPython
#42MicroPython seems to be heavily focused on embedded systems . Is there any support for embedding it within an application , i.e. as a replacement for Lua? Or is there another lightweight Python implementation (or Python-like language) that supports this?
Many applications in the graphics space embed or otherwise allow Python scripting. Some open source examples are: Blender, FreeCAD, GIMP, Inkscape.
Re: MicroPython
#43Earlier quoted context omitted.
It runs very well on ESP32.
I've done work for a couple of clients, converting a micropython implementation to C on and ESP32, that would disagree with that statement.
Re: MicroPython
#44MicroPython is stellar. If you're building an embedded system for people to hack and customize, make the highest level abstraction of the embedded system in MicroPython so that users can easily modify/patch/contribute/hack your system with ease. This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython. In this [1] PyCon talk by Matt Trentini, a demo of QR code g…
Re: MicroPython
#45MicroPython seems to be heavily focused on embedded systems . Is there any support for embedding it within an application , i.e. as a replacement for Lua? Or is there another lightweight Python implementation (or Python-like language) that supports this?
Re: MicroPython
#46Neat, but not very practical. To be of any use you still need board support to drive the I2C, SPI, etc which means you have to use C anyhow. You can buy one of their boards with the BSP but that's over $40, yikes. To use micropython you need at least an M4 class micro-controller so that a $5 or greater part. Or you could just stick with C and use a M0 class micro that costs A difference of $40 in BOM cost makes it on…
Re: MicroPython
#47MicroPython seems to be heavily focused on embedded systems . Is there any support for embedding it within an application , i.e. as a replacement for Lua? Or is there another lightweight Python implementation (or Python-like language) that supports this?
Why would you want to replace Lua in this space? At least why replace with another dynamically typed, imperative scripting language, but without tail-call optimization? What would be the gain?
Re: MicroPython
#48Earlier quoted context omitted.
I wouldn't say "very tiny". For example, does it run (and can do something useful) on a 8 KB cortex M0 with 24 KB of flash?
For that, maybe snek[1] would be more suited. [1] https://sneklang.org/
> Like Python, Snek doesn’t have an explicit Boolean type.
Re: MicroPython
#49Neat, but not very practical. To be of any use you still need board support to drive the I2C, SPI, etc which means you have to use C anyhow. You can buy one of their boards with the BSP but that's over $40, yikes. To use micropython you need at least an M4 class micro-controller so that a $5 or greater part. Or you could just stick with C and use a M0 class micro that costs A difference of $40 in BOM cost makes it on…
Is it as fast as C? No. Does that mean it's useless? No.
The absolute coolest thing is to take a $2 Wemos D1 clone, put micropython on it, hook it to a sensor (I've been using temp and humidity sensors lately) and have it periodically fetch "&p="" rel="nofollow">http://webserver-ip/temp?t=&p=" every 10 seconds and have a little python webserver sitting on an machine on your network that is stuffing the values into influx or some other DB.
This is trivial to do, and takes little to no embedded coding experience on the ESP8266. That's a win as far as I am concerned.
Re: MicroPython
#50There also exists a Python-like language for when you only have a few kb of memory, and can’t even run MicroPython. It’s called “Snek”: https://sneklang.org/
But, my impression is that Snek is mostly for "learning" while MicroPython is intended to do "real work" (obviously those are not disjoint categories).