r/Python • • Sep 08 '19

Possibly the most terrifying O'Reilly cover I've ever seen

Post image
1.3k Upvotes

69 comments sorted by

176

u/kumashiro Sep 08 '19

I agree. Embedded programming sometimes is the root cause of my sleepless nights...

41

u/house_monkey Sep 08 '19

Crying yourself to sleep helps sometimes

12

u/kumashiro Sep 08 '19

That's what I usually do... curled up in a corner of the room, looking at the book of x86 instruction set with all those fancy stuff like SQRTPD...

16

u/[deleted] Sep 08 '19

I know this is a joke, but if you really have struggled with embedded programming, micropython is a godsend. That book is a little basic, but micropython makes embedded systems so much more fun!

17

u/kumashiro Sep 08 '19

Yes, I was partially joking, but language is not the problem in my case (and to be honest, I prefer C for that, simply because it feels more predictable for me). Python won't help with "talking" to a board you have incomplete and outdated documentation for and that's the main reason I sometimes hate embedded programming :(

But, when everything works and you have access to a good, complete and up-to-date documentation for chips and devices, it is a lot of fun. Even when months after assembling the board you notice there's a pull-up missing and one of the chips does very interesting stuff when placed near the radio transmitter... ;)

2

u/Tengoles Sep 08 '19

Would you say that embedded devices with micropython can be used professionally?

3

u/kumashiro Sep 08 '19

Sure. But I personally would use it for things like HTTP management panel, rendering things for displays, higher level logic etc. Close to metal stuff I would keep in C and ASM, for example as a Python module. I'm not comfortable with doing timing-sensitive things and handling hardware interrupts in interpreted languages, but it's probably just my little quirk. Micropython can be great at that, I don't know. You should ask someone experienced with Micropython :)

2

u/archaeolinuxgeek Sep 09 '19

In the DIY projects I've done around the house, I pretty much always prototype with uPython. Being able to interact with sensors via a REPL is huge. Once I have everything where I want it, I'll usually port it to Lua or C. My argument is that it can absolutely be used professionally, but I'd be wary of using it production. I've seen a few random resets, but it's very likely that the bug was between the chair and the keyboard.

63

u/WystanH Sep 08 '19

Holy crap! That was my thought even before I read the title. MicroPython has, um, Cthulhu for a mascot?

13

u/[deleted] Sep 08 '19

It would appear to belong in r/lovecraft

10

u/RomanRiesen Sep 08 '19

Dude. It's just a fancy caterpillar.

5

u/GummyKibble Sep 08 '19

Oh! That’s obvious now, but at first glance it looked like a conga line of little aliens waving their flagella-arms in the air.

1

u/RomanRiesen Sep 09 '19

I hope the poor you didn't hurt the poor fella's feelings.

1

u/WystanH Sep 08 '19

Totally what you'd say about Cthulhu right before... aaaaaah.

1

u/pingus3233 Sep 08 '19

They should have had a picture of scabies, because they get "embedded" under your skin.

2

u/scaba23 Sep 08 '19

I thought it was a gang of beholders

35

u/Attack_Bovines Sep 08 '19

It’s a gentle reminder of the bugs that you’ll create with it.

30

u/easylifeforme Sep 08 '19

what is micropyththon?

68

u/CobbITGuy Sep 08 '19

Python programming language for microcontrollers. Works on a bunch of popular hobbyist MPU like ESP8266, ESP32, STM32 Cortex M0+ (Arduino Zero), and most lately STM32 Cortex M7. Many others are unofficially supported. https://github.com/micropython/micropython

Adafruit has a "fork" of it called CircuitPython.

9

u/toyg Sep 08 '19

It’s an implementation more than a “programming language”, afaik. Damian took CPython, stripped it as bare as he could, then added a few extra bits.

1

u/TunaLobster Sep 08 '19

I might have to give it a try on a SAMS21 chip. The ESP8266 neopixel stuff didn't have great performance last time I used it.

1

u/ThwompThwomp Sep 09 '19

I've played with circuit python some and its interesting. I'd love to use it more, but I don't think it supports interrupts or low power modes. A game stopper for much more than simple projects of only academic/educational interest.

1

u/CobbITGuy Sep 09 '19

CircuitPython does not support interrupts, but MicroPython does. CircuitPython is Adafruit's version, and they aim for a simpler experience than regular MicroPython from tool chain through programming.

10

u/[deleted] Sep 08 '19

Subset of Python for microcontrollers.

5

u/MonkeyPanls Sep 08 '19

Luna moth caterpillar.

4

u/WikiTextBot Sep 08 '19

Luna moth

The Luna moth (Actias luna) is a Nearctic moth in the family Saturniidae, subfamily Saturniinae, a group commonly known as giant silk moths. It has lime-green colored wings and a white body. The larvae (caterpillars) are also green. Typically, it has a wingspan of roughly 114 mm (4.5 in), but can exceed 178 mm (7.0 in), making it one of the larger moths in North America.


[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source ] Downvote to remove | v0.28

2

u/sempf Sep 08 '19

We have so many this year. Gonna be a neat fall. They grow big here in our valley.

4

u/blitzcat Sep 08 '19

I’ve worked with Nick on Micropython at pycon in the past and he is really passionate about it, the ecosystem and helping beginners. I would expect good things from the book.

7

u/0x0012013 Sep 08 '19

Would you consider this a good place to start with embedded? I've been crazy curious about it forever, but have no idea where to start.

20

u/Zouden Sep 08 '19

Not if your goal is to actually learn about microcontrollers. If you just want to use Python to control hardware then yeah it's great. Micropython is a lot faster to write than C++. Using it to blink LEDs is fun.

But you'll learn more if you just pick up a traditional Arduino (which uses a simpler 8-bit chip with no operating system) and write some simple C++ code.

The other issue is that Micropython is still in early stages and has multiple forks with different features, so it's a bit confusing for a beginner.

3

u/louky Sep 08 '19

Just grab a $2 Arduino clone and go to town. Great way to get into it, there's a ton of options.

3

u/realestLink Sep 08 '19

No. Most embedded is done in C/C++. You can buy an arduino uno for pretty cheap and buy "learn ansi C" (or find it for free online) and you can start on your embedded journey.

3

u/blitzcat Sep 08 '19

No. It’s tangential to embedded, but if that is your goal, start with a reference architecture like NXP’s k64 MBED board and their ide ecosystem. Skip all the adafruit and raspberry pi stuff.

1

u/shriek Sep 08 '19

Are you talking in terms of hardware or software? If hardware then you can start with a simulation in Tinkercad but I'd like to know on the software side too. Really don't want to put much effort on learning C/C++.

1

u/realestLink Sep 08 '19

Why the hate of C/C++ though? C is a pretty great language.

2

u/shriek Sep 08 '19

Not really hating on the language. It's just in my radar right now. I've done C in the past but that was in C89 and I haven't kept up with the language.
Currently, I mostly do JS, Python, Go and sometimes Rust so haven't had time to learn another language. I don't mind learning it (once they add package manager :P) if I get serious into embedded programming but as a hobby I'm just looking into anything alternatives for now.

1

u/chmod--777 Sep 08 '19

C++ takes a lifetime to learn. C is a matter of weeks if you know programming and the concepts. Stupid simple language without any real magic... I wouldn't stress on learning it as much as figuring out how to write good C code that's clean and not buggy.

C is amazing, but the only intimidating aspects should be the stack/heap, pointers and references and memory management aspects, not the language and its features but how you use it effectively. "Getting stuff done" is easy though, just time consuming in C.

1

u/louky Sep 08 '19

C/C++ is the lingua franca of embedded systems, and will be for the foreseeable future.

3

u/Stanulilic Sep 08 '19

I was expecting to see a Python with its mouth open, ready to bite.

3

u/Due_Generi Sep 08 '19

How does MicroPython compare to C in terms of efficiency?

Is it really worth using on an MPU?

5

u/[deleted] Sep 08 '19

What do you mean by efficiency? In terms of power consumption, it's less efficient than you could get it if you wrote your C carefully, but I found that it was just as fast (or fast enough).

Personally, I use it for rapid prototyping. Get the functionality of the code down and work out the bugs, then I port it to C after if I really care about the power consumption (powered by a battery, for example).

3

u/Due_Generi Sep 08 '19

What do you mean by efficiency? In terms of power consumption, it's less efficient than you could get it if you wrote your C carefully, but I found that it was just as fast (or fast enough).

More so in terms of memory. I suppose if it's of a similar speed, it's optimized well.

Personally, I use it for rapid prototyping

And that's why I love Python. Great for rapid prototyping, and in many cases apt for production.

5

u/Axeperson Sep 08 '19

Layman's question: is there also a Monty Python?

9

u/WalnutNode Sep 08 '19

There used to be lots of them, but they were banished to the Everglades after the purge.

3

u/[deleted] Sep 08 '19

You could say that normal Python is "Monty Python" since that's where it got its name.

2

u/kristopolous Sep 08 '19

I'm still waiting for their "Introduction to Entomology" book with a picture of like an iPhone on it.

2

u/13ass13ass Sep 08 '19

I’m sorry, Guido

1

u/as8297 Sep 08 '19

What's micropython?

Is it more efficient then Python ?

2

u/norweeg Sep 08 '19

https://micropython.org/ MicroPython - Python for microcontrollers

1

u/vigilantepro Sep 08 '19

Sorry for the stupid questions, I'm new to Python. How does it work for programming controllers? Is there native hardware functions by default in Python? Or is the another layer of code language in the stack?

1

u/CupFan1130 Sep 08 '19

Auto Parts!

1

u/thatguy16754 Sep 08 '19

Was this written by apt28 cause that caterpillar is so fancy

1

u/BrettFavreFlavored Sep 09 '19

Gaze upon the microcontroller optimized python, despair at it's eldritch horrors.

1

u/Naesme Sep 09 '19

I shall it Fred.

1

u/youguess Sep 09 '19

you haven't been in a garden much, have you?

1

u/AddictedToCoffeeee Sep 08 '19

Yeah, micro my ass

1

u/[deleted] Sep 08 '19

KILL IT WITH FIRE

0

u/bsmdphdjd Sep 08 '19

When did totally irrelevant cover art become such a fad?

5

u/Canadauni1 Sep 08 '19

O'Reilly has been putting animals on their cover art since the 80s: https://www.oreilly.com/ideas/a-short-history-of-the-oreilly-animals

2

u/Pseudoboss11 Sep 08 '19

I'm pretty sure that totally irrelevant cover art has been a thing since cover art has been a thing.

-1

u/Ketta Sep 08 '19

5

u/WikiTextBot Sep 08 '19

Tardigrade

Tardigrades (), known colloquially as water bears or moss piglets, are a phylum of water-dwelling eight-legged segmented micro-animals. They were first described by the German zoologist Johann August Ephraim Goeze in 1773, who called them little water bears. In 1777, the Italian biologist Lazzaro Spallanzani named them Tardigrada, which means "slow steppers".They have been found everywhere, from mountaintops to the deep sea and mud volcanoes, and from tropical rain forests to the Antarctic. Tardigrades are among the most resilient animals known, with individual species able to survive extreme conditions—such as exposure to extreme temperatures, extreme pressures (both high and low), air deprivation, radiation, dehydration, and starvation—that would quickly kill most other known forms of life.


[ ^PM | Exclude ^me | Exclude from ^subreddit | FAQ / ^Information | ^Source ] Downvote to remove | v0.28

0

u/[deleted] Sep 08 '19

Damn, smexy.

0

u/Harbinga Sep 08 '19

Yes, Creepy as hell. I suggest adding Cats.

0

u/checock Sep 08 '19

I thought it was a shop at first. Had to check by myself.

0

u/[deleted] Sep 08 '19

Picture = scary Scary = nightmares_for_12_days

0

u/niyrex Sep 08 '19

Yes, realizing safety critical embedded system could be written in a dynamically typed language with runtime exceptions gives me the hebegebes.

0

u/[deleted] Sep 08 '19

[deleted]

4

u/wrtbwtrfasdf Sep 08 '19

/r/imsorryjon was definately on my mind when I saw this.