Live data from Hacker News

MicroPython – Python for Microcontrollers

micropython.org

91–100 of 106 posts

Re: MicroPython – Python for Microcontrollers

#91
post #90

Earlier quoted context omitted.

> Some would argue that the various ways you can trip over UB makes them more fragile That is definitely a factor! But I probably wouldn't pick C++ for a medical device now anyway - I would go with Ada or Rust. > Systems are typically fragile because of poor system design not language choice. Poor system design and language choice are both factors. You can work around language choice with a shit load of testing, but…

Bashing Python, or language-bashing in general, makes you sound like an immature and unprofessional programmer. Python is perfectly fine when used in the proper way by a knowledgeable professional, and Rust can be a dangerous tool when used by a beginner. It takes the knowledge of a tool to use it properly and safely; just because someone hit themselves on the head with a hammer doesn't mean hammers are inferior to n…

Sure, Python has its place. But that place is not where you need the software to work extremely reliably.

If pointing out relevant and real differences between languages counts as "bashing" then I'm not sure how you are meant to discuss it.

Language choice does have an effect on program robustness. That's just a fact. And it's also pretty indisputable that Python lacks many features that help to write robust code.

Pretending that isn't true is immature and unprofessional.

It has some pros of course - having a REPL is good for experimentation, and it has a great library ecosystem for example. But neither of those are particularly important for commercial medical devices.

Re: MicroPython – Python for Microcontrollers

#92
post #90

Earlier quoted context omitted.

Bashing Python, or language-bashing in general, makes you sound like an immature and unprofessional programmer. Python is perfectly fine when used in the proper way by a knowledgeable professional, and Rust can be a dangerous tool when used by a beginner. It takes the knowledge of a tool to use it properly and safely; just because someone hit themselves on the head with a hammer doesn't mean hammers are inferior to n…

Sure, Python has its place. But that place is not where you need the software to work extremely reliably. If pointing out relevant and real differences between languages counts as "bashing" then I'm not sure how you are meant to discuss it. Language choice does have an effect on program robustness. That's just a fact. And it's also pretty indisputable that Python lacks many features that help to write robust code. Pr…

Please explain what you think is important about commercial medical devices, because having worked in the industry I can tell you the FDA is the hurdle and it's going to be as hard to convince them that C or Rust or Ada is safe to use for a medical device as it would be to convince them that Python was safe, and in the process you will certainly be ensuring there are safety controls for each item on the software FMEA, whatever your chosen ecosystem.

Re: MicroPython – Python for Microcontrollers

#94

Earlier quoted context omitted.

That's worrying. I can't think of a less appropriate application for something as fragile as Python.

I agree. Using MicroPython in medical applications is with all due respect worrisome. It's not meant to be for crucial tasks and definitely not optimal at all for MCUs. It's really meant to be for simple, hobby applications. It's too high-level (synonym of inefficient) for MCUs. C and Assembly are the way to go for these critical applications (that's why NASA & SpaceX use C and assembly in embedded electronics). Reli…

Thanks for telling us what MicroPython is for. :P

(BTW, I can't vouch for NASA or SpaceX, but it's no secret that the European Space Agency has been working with MicroPython for many years.)

I don't disagree that reliability, repeatability and fast performance are (often) key; but our experience suggests that these can be (usually, if not always) achieved with MicroPython.

Re: MicroPython – Python for Microcontrollers

#95
post #30

Earlier quoted context omitted.

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

What did you end up using MicroPython for?

Frontend for writing behavioral experiments. So backend runs C++ signal processing etc, graphics display, or whatever we need, all of that has bindings for MicroPython.

Works very well, but: it's still Python. Great, but dynamic so not the best suited for larger applications in my experience - no matter how well-architected the code is. Becomes just really hard to refactor without breaking anything.

Re: MicroPython – Python for Microcontrollers

#96
post #85

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…

Did you try running it on top of Zephyr?

I don't personally use the Zephyr port, though it has plenty of potential. But it's worth sharing that the Renode folks have put together a MicroPython on Zephyr dashboard to show that at least 90 of their simulated boards appear to reach the REPL:

https://zephyr-dashboard.renode.io/dashboard-micropython.htm...

Any of those that are passing would be a good board to choose to start with.

Re: MicroPython – Python for Microcontrollers

#97

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.

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

Yeah, right. Now if i find out why it gives syntax error on a perfect part of code.

Re: MicroPython – Python for Microcontrollers

#98

Earlier quoted context omitted.

Not really. Probably only a single-digit percentage of software developers will ever get to use any of these professionally. Howl in protest if you will, but the truth is that all of these (and more) are mostly the domain of students and hobbyists. If you are already in the industry, and part of the 90+% unwashed masses, then you already know this. If you are a student or hobbyist who hasn't clued into this reality y…

This is mostly true, but (I cannot believe I am going to do this), Rust is in a different tier compared to the other languages in the list. From the last who is hiring thread: Zig =0 mentions Nim = 0 mentions Julia = 2 mentions C# = 4 mentions C++ = 12 mentions Rust = 13 mentions Java = 18 mentions JavaScript = 30 mentions Python = 50 mentions The threads here are not indicative of the overall market and 1 mention !=…

I should not have chosen Pascal as my primary programming language.

It is not even mentioned when looking for uncommon language mentions

Re: MicroPython – Python for Microcontrollers

#99
post #92

Earlier quoted context omitted.

Sure, Python has its place. But that place is not where you need the software to work extremely reliably. If pointing out relevant and real differences between languages counts as "bashing" then I'm not sure how you are meant to discuss it. Language choice does have an effect on program robustness. That's just a fact. And it's also pretty indisputable that Python lacks many features that help to write robust code. Pr…

Please explain what you think is important about commercial medical devices, because having worked in the industry I can tell you the FDA is the hurdle and it's going to be as hard to convince them that C or Rust or Ada is safe to use for a medical device as it would be to convince them that Python was safe, and in the process you will certainly be ensuring there are safety controls for each item on the software FMEA…

I'm talking about actually making reliably devices, not just satisfying regulations.

> Please explain what you think is important about commercial medical devices

I'm not exactly sure what you're asking here. Medical devices are often safety critical. They need to work extremely reliably. That's obvious; I think I must have misunderstood your question sorry.

Re: MicroPython – Python for Microcontrollers

#100

I use a hybrid architecture that is working quite well for interactives in my little corner of the museum industry. I pair a raspi running either node-red or python with a Teensy coprocessor running embedded C code and handling the IO. The two communicate via UART serial via either firmata or a custom protocol as the project requires. Having the Teensy handle IO lets me tie directly into pin interrupts, FlexIO, DMA a…

That's interesting. What firmware are you running on the Teensy? The 3d printer software Klipper uses a similar architecture, and I'm very impressed at the general purpose motion control firmware they've written for that project, to the point that I'm strongly considering using it in my own (non-3d-printer) projects. Did you write it yourself?
Post reply on HN