Live data from Hacker News

MicroPython

micropython.org

121–130 of 152 posts

Re: MicroPython

#121

Does anyone have any experience beyond short programs/sketches with micropython? The most I've used it for is playing around with a microbit. How does it hold up?

I've been trying to make a (toy) contact-tracing system on microbits with micropython, but keep hitting RAM and flash limits; the lack of being able to write in append mode severely limits it's usefulness as an offline datalogger

Re: MicroPython

#122
Can someone help demystify this for me?

If I got out a microscope and looked at cross sections of a pyboard, could an expert point out the sections of physical gates and other parts that implement each python bytecode?

Re: MicroPython

#123

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…

I don't want even less types in my code though; I don't want Python on Arduino, I want Rust: https://github.com/avr-rust/ruduino

How beautiful would that be; an awesome package manager (Cargo), strong types, blazing fast bare metal performance, safe memory and less strange errors that are hard to debug in an embedded system!

Re: MicroPython

#124

Earlier quoted context omitted.

Yes, this is a complete game-changer; I love showing experienced embedded engineers how to connect to the REPL, and poke live, interactive I2C or SPI at a peripheral. :)

I only wish Micropython had a real debugger (pdb).

#5026 was merged last year; it provides the sys.settrace primitive which paves the way for debugging support.

https://github.com/micropython/micropython/pull/5026

Still quite a lot of work left for pdb-like features but I'm optimistic it'll get there!

Re: MicroPython

#125

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…

I'd love to try it out but the realm in which I am moving is around 32K of flash and 6K RAM. And if my research was not wrong MicroPython needs at least 256K flash and 32K RAM, and that's without any user program in Python on top of that. That's quite a lot ...

That's roughly true: 32KB RAM and 256KB Flash will provide a decent MicroPython environment. I'm afraid if you have fewer resources than that you should probably look at other alternatives.

Re: MicroPython

#126

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…

The biggest thing you are underselling (if at all), is that you can have a repl directly into the device itself and doing lots of exploratory programming directly in-circuit.

PEEK

POKE

(who named these interesting commands?)

Re: MicroPython

#127
post #126

Earlier quoted context omitted.

The biggest thing you are underselling (if at all), is that you can have a repl directly into the device itself and doing lots of exploratory programming directly in-circuit.

PEEK POKE (who named these interesting commands?)

[deleted]

Re: MicroPython

#128

Can someone help demystify this for me? If I got out a microscope and looked at cross sections of a pyboard, could an expert point out the sections of physical gates and other parts that implement each python bytecode?

No - this is implemented in software on a general-purpose processor. You can't read flash contents optically with a microscope, so the software part is invisible. You can certainly identify the bits of the general-purpose processor though.

Re: MicroPython

#129

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…

I understand what value MicroPython holds for Python community who want to get into embedded computing. But aren't these contradictory - >but it is time to ditch C/C++ for MicroPython. >Therefore, it is critical to put performance demanding code in C/C++ modules and compile a MicroPython bindings I understand that these are underlying issues of Python itself and I've been burned before because of it. Had a massive py…

Thanks for the insight, in your experience how has the performance been?

Re: MicroPython

#130
post #35

There 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/

That’s cool. Hadn’t seen that one. What is a “few kb”? Because last I looked Micropython was like 256kB and the smallest JS interpreter that had foreign function interface was 53kB.

> What is a “few kb”?

From the manual:

> […] could fit on our existing Arduino Duemilanove compatible hardware. This machine has:

> 32kB of Flash

> 2kB of RAM

[…]

Post reply on HN