5 ms·
Right now we are going in the opposite direction. Web developers on HN refuse to learn proper embedded programming, and instead stack abstraction on top of abst
by melony 5y ago
Right now we are going in the opposite direction. Web developers on HN refuse to learn proper embedded programming, and instead stack abstraction on top of abstraction with MicroPython and using Raspberry Pis for every job under the sun.
It is a shame that Arduino/AVR never bothered implementing support for the full C++ library. If the full power of C++ is available to the end user, then perhaps alternatives like MicroPython would be less attractive.
- mwcampbell 5y agoSure, that's happening, but some of us are also tempted to use Rust for applications where an easier to learn, more popular language would be good enough.
- eof 5y agoThis doesn’t seem like an apt comparison. Using the wrong tool for the job is expensive forever; learning a tough language pays dividends forever.
- tartoran 5y agoI think MicroPython is a boon to beginners in the space. They have the option to go deeper when the projects run into limitations.
- curryst 5y agoI would tend to disagree because MicroPython is so abstracted that it resembles writing regular Python on a server more than it does anything embedded. Just as an example, the WiFi setup resembles a server far more than an ESP32 with esp-idf. All you do is give it the connection details, and MicroPython seems to handle the details like trying to reconnect in the background. It's not far off from what systemd-networkd or similar provides. esp-idf forces you to handle that yourself, and to think about what you want to happen in that situation. MicroPython also doesn't support threads afaict, so you don't even have to handle scheduling threads. I like MicroPython as a way to run Raspberry Pi like stuff on the cheap, and it's a great learning tool in that sense, but you're still too far from the hardware to really be learning about embedded systems.
- pjmlp 5y agoSo like BASIC Stamp and Propeller? Or like C64, Atari, ZX, Amiga, TI BASIC?
- pjmlp 5y agoOn the contrary, because the experience isn't the same, with MicroPython you drop a py file over the usb and you are done. There is a REPL experience, and Python comes with batteries, even if MicroPython ones are tinier. Python is the new BASIC in such hardware. Also the Arduino folks don't seem to have that high opinion about C++, https://www.youtube.com/watch?v=KQYl6th8AKE https://www.youtube.com/watch?v=KQYl6th8AKE
- ncmncm 5y ago"Arduino folks" are defined by their limited engagement, so are not reliable arbiters of the value of tools in the toolbox.
- pjmlp 5y agoIf you bothered to watch the linked video, the Arduino folks are the ones that produce the tools in the box. They only picked C++, because C would be even worse, and it provided an easy way to have their Arduino like language without creating their own compiler. They have no plans to ever provide proper C++ support. So if that makes you jump, go watch a Dan Saks talk about C++ adoption on embedded domain or not.
- iostream23 5y agoThey picked c++ because it’s a low level capable language that has a reasonably familiar syntax, and their primary training wheels are these simplified arruino libraries. The actual runtime framework with its “setup” and “loop” methods is a reasonable proxy for an RTOS or the framework an experienced embedded developer would have built as a general runtime system. There’s nothing wrong with Arduino, except that its SPI SD card library won’t give you good bandwidth but that’s because they wanted it to be an understandable simple access library for SD cards, and you will need to go further if you want reasonable performance.
- iostream23 5y agoYour metaphor that “python is the new basic” stems from desktop computers use of BASIC to teach beginning programming skills on largely 8 bit machines. Once you started with BASIC you presumably moved to learning assembly language, as many of these machines gained c compilers, you might have tried to obtain one. The entire point of micropython is a friendly introduction or friendly prototype platform or learning platform. In no way does micro python take advantage of the hardware nor could it ever directly talk to hardware. One should not treat all programming languages the same as they have different purposes and python is not fit for the purposes a c or c++ is fit for, aka memory allocation etc. The number one lesson a beginning embedded programmer should take away from arduino is that controlling hardware is about writing specific bit patterns to memory locations. Sorry, this is not something python can do or was designed for. Deeply embedded means “embedded Linux won’t suffice” Your car braking system had better not be a micropython program. There are actual safety proofing systems in which code is proven, and the python interpreter itself will not come close to passing as the complexity is too large. (Formal verification is the Search term you seek (