Live data from Hacker News

MicroPython

micropython.org

91–100 of 152 posts

Re: MicroPython

#91
post #14

MicroPython 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?

Digi International embedded it into some of their XBee wireless radios (802.15.4-based and Cellular models) to allow customers to run an on-device application without compromising any certifications for the radio portion of the firmware. Easier than needing to design hardware with an additional host processor and work out the serial communications between that host and the radio module.

While MicroPython was designed to be "bare iron", it wasn't overly difficult to port it to run as a separate task inside the XBee firmware, and connect it up with internals for I/O and file system access. These are ARM Cortex products with firmware sizes in the area of 500KB to 700KB.

Re: MicroPython

#92
post #25
post #14

MicroPython 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?

I'd prefer to use a language that's more orthodox than Lua, e.g. one with class-based OOP and separate lists & maps, rather than tables-for-everything.

I'd also like a language that puts more emphasis on backwards-compatibility than Lua. Sure, everyone complains about the Python 2 => 3 transition, but there have been 3 new major versions of Lua since the release of Python 3.

Re: MicroPython

#93

MicroPython 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…

Hey, that's me - if anyone has questions about that then you can ama!

Re: MicroPython

#94
post #65

MaixPy ported Micropython to K210 (a 64-bit dual-core RISC-V CPU with hardware FPU, FFT, sha256 and convolution accelerator). It includes a general-purpose neural network processor, which can do convolutional neural network calculation at low power consumption, for example obtain the size, coordinates and types of detected objects or detect and classify faces and objects. It can load TensorFlow Light Neural Nets. htt…

That is awesome! Unfortunately the K210 link on the site is giving me a certificate error so I'm a bit afraid clicking into it. Do you know if the library will work with ( https://www.seeedstudio.com/Sipeed-Maix-Cube-p-4553.html )?

It does; in fact with my Maix Cube it came shipped with it pre-loaded.

Re: MicroPython

#95
post #29

Earlier 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.

The ESP32 port still has a few rough edges, particularly around peripheral control. But it's a popular device and the port is improving all the time.

Re: MicroPython

#96
post #2

I think this is good for someone getting started with microcontrollers(similar to the Arduino) However, one should not be disillusioned — I doubt this can be used to deploy a mass market product. However, I can see micro-python’s value in rapid-prototyping to some extent for someone who is not into embedded/firmware as much.

Everyone is open to their opinion; in the meantime the company I work for uses it for mass market devices in the medical domain. ;)

Re: MicroPython

#97
post #8

> MicroPython implements the entire Python 3.4 syntax Python 3.4 is now over 6 years old. Are there plans to add features from newer Python releases? Or perhaps the developers feel that Python's newer features wouldn't "pull their weight"?

Python 3.4 is actually the baseline for MicroPython these days. Many other more modern features have crept in; such as f-string support that was recently added. And the asyncio support is a modern implementation too...

Generally MicroPython can absorb modern Python features where the implementation can be shown to be efficient, particularly with low RAM costs.

Re: MicroPython

#98

Can anyone comment on what parts of Python are not in MicroPython?

The language is surprisingly complete; bigger differences are found in library support, even standard library support. Libraries that are memory efficient are easy to port but many Python libraries assume vast amounts of memory so it can require significant effort to modify them to use few resources.

Re: MicroPython

#100
post #30

MicroPython 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…

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.

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.

Post reply on HN