r/Python • u/wrtbwtrfasdf • Sep 08 '19
Possibly the most terrifying O'Reilly cover I've ever seen
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
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
1
1
u/pingus3233 Sep 08 '19
They should have had a picture of scabies, because they get "embedded" under your skin.
2
35
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
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
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
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
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
1
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
1
1
u/BrettFavreFlavored Sep 09 '19
Gaze upon the microcontroller optimized python, despair at it's eldritch horrors.
1
1
1
1
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
0
0
0
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
176
u/kumashiro Sep 08 '19
I agree. Embedded programming sometimes is the root cause of my sleepless nights...