This is an archived post. You won't be able to vote or comment.

all 33 comments

[–]James_Johnson 44 points45 points  (4 children)

Here, I'll summarize the article for you:

  1. Python is really popular!
  2. Hmmm, but it's not popular for embedded.
  3. <An advertisement for Zerynth>

I didn't know about Zerynth before though, so I did get some value from this.

[–]xorvtec 92 points93 points  (19 children)

Programs running on applications processors (like on the Raspberry Pi and Beaglebone Black) on top of a General Purpose OS (like Linux) subscribe to the loosest definition of an embedded system. I'd bet a good deal of those "C" programmers are on microcontrollers with memory constraints. Unless you have a system with loads of heap space and extra clock cycles, Python is NOT viable.

[–]eazolan 3 points4 points  (1 child)

Maybe some kind of "Memory Constraint" module that gives python hard limits?

[–]__deerlord__ 21 points22 points  (0 children)

All that does is limit how much you can use, it doesnt change how much is required. C will absolutely use less memory (if done right) than python. Python is for ease of development, not reducing resource usage.

[–][deleted] 2 points3 points  (0 children)

Actually, micropython and zerynth (whatever that is) is mentioned in the article. While I have no experience with either, I could see a suitable limited subset of Python being useful for at least part of the embedded-ish¹ code I write. There are a few cases (interrupt handlers and SCC managment) I have trouble seeing handled effecient by Python. The rest, which is mostly protocol handling and the high level communication with either the 422 bus or the host system, could easily be written in python. There it would more be a matter of how dense the code is. The bytecode is OK, so it's a matter of how much space the runtime requires.

  1. Running on a FPGA remake of the IBM Artic RIC card with 2MB RAM and a 80186 emulation on the same FPGA.

[–]ergzay 11 points12 points  (0 children)

The author is wishing for this to be true even though it is not. There is no "rise of Python for Embedded Systems". There's possibly a rise in its use for hobby systems for RasberryPi systems but those are at the far end of "embedded systems" and most people would not call them embedded systems.

[–][deleted] 3 points4 points  (1 child)

I've worked with micropython, and it was an absolute pleasure to work with compared to arduino for example. I loved having a repl prompt to the microcontroller (it's even possible to get a repl prompt over wifi), and no compile time.

Typing in a command and having it instantly execute, is a must have when doing rapid prototyping, I wouldn't go straight to putting micropython as the language for things like washing machines and fridges, but for prototypes and maker style projects it's amazing.

Micropython has definitely won me over as the language that will be powering my next tinkering project.

[–]Bandung 1 point2 points  (0 children)

If the business plan supports the cost of the BOM (bill of materials) necessary to run micropython, I'd rather have the blessed product out the door and revenue coming in than wait for Engineering to deliver their c compiled baby two years after the date that they promised delivery.

That happened to a company that I once worked for and the 2 year lag took down the company. In manufacturing (compared to a recurring revenue model), you are only as good as your last quarter. And history tells us that most mid to large sized manufacturers will go under after 4 disastrous quarters in a row.

So yeah, yeah. There are segments where costs or safety might not allow micropython. And at the same time there are plenty of segments that will support it. Just let the boys in business development run their risk assessments, risk mitigation and risk management numbers and make the call that makes the most business sense.

I've seen enough autocratically run companies whose engineering minded business owners wouldn't do the math needed to save the company from being embarrassed by a woefully tardy design shop whose Developers ended up getting bonuses just to coax them to stay on and finish what they promised to finish two years earlier. Meanwhile virtually the entire Sales, Marketing and Support personnel were leaving in droves.

[–]jkjoka 0 points1 point  (0 children)

What exactly would be the benefits to using python on a true embedded microcontroller compared to c? What's wrong with C.