https://github.com/micropython/micropython/pull/5026
Still quite a lot of work left for pdb-like features but I'm optimistic it'll get there!
POKE
(who named these interesting commands?)
> One of the earliest references to these commands in BASIC, if not the earliest, is in Altair BASIC[4].
[4] https://archive.org/stream/bitsavers_mitsMITSAl_6669937/MITS...
So, it seems to date back to 1975.
We should make Rust compile to Arduino and other embedded devices and be done with it.
Write your low-level/high performance code in whatever. Then write top-level logic-- and let your users script in-- micropython.
I'm teaching a middle school class this year with micropython on embedded. I can't fit Rust in with everything else I'm teaching in one trimester. I've even written an IDE which runs in the browser (on chromebook, etc) so there's no external dependencies for them.
upip install foo
at runtime!My brother taught a robotics team where he used https://www.adafruit.com/product/3333 and was really happy with it... but I wanted something a little beefier and to have wireless options.
It's still significantly faster than developing wholly in C - or Rust for that matter. And that's if writing in a low level language is required at all.
[0] - https://github.com/dcmorton/esp32-micropython-image-builder
This was one of the reasons CircuitPython was forked from MicroPython. Adafruit wanted consistency across all the platforms they sold and one of the features they insisted on was the USB drive support to make it easier for the educational market they cater to.
How hard is to write bindings for micropython?
I've looked into cython but I'm not sure it's what I really need.
This might help: https://github.com/stinos/micropython-wrap
EDIT: actually neither FFI or this wrapper you linked are what I need. I need to execute micropython from C++, not the other way around.
But aren't these contradictory -
>but it is time to ditch C/C++ for MicroPython.
>Therefore, it is critical to put performance demanding code in C/C++ modules and compile a MicroPython bindings
I understand that these are underlying issues of Python itself and I've been burned before because of it. Had a massive python project in my previous startup, it became very clear soon enough when the user base grew that only way to extract meaningful performance(and to bring down server costs) was to replace core components with C-extensions(e.g. Concurrency, Networking). Although we were able to do it, it is a huge overhead for a small startup and capital intensive.
If I have to recommend Python to someone who is new to programming, I have to add a disclaimer that "If you want to build something which demands serious performance with it, you'll also have to learn C/C++"
All those can be avoided, if we could just take up a language which was specifically built to fix the underlying issues with Python i.e. If it's the utility we want, then Go.
As far as embedded is concerned, TinyGo does what MicroPython does. But I've found solace with Gobot via Firmata, although it demands Client-Server architecture the utility of not having to flash the Microcontroller each time we make a change is worth it, besides having all the libraries we have in the Go ecosystem at our disposal. I would recommend this for home projects where Client-Server arch is not an issue, I recently built a 'Butt Triggered Pomodoro Timer' with it[1].
[1]https://abishekmuthian.com/butt-pomodoro-a-butt-triggered-po...
Most projects are integrating parts into a whole. While expert programmers might be needed to create the parts & package them as libraries, how often is the same true of larger assemblies of parts that solve a domain problem?
Blueprints in Unreal Engine are an interesting case study. Programmers create components in C++ and expose APIs for them. Level designers use Blueprints to integrate & orchestrate those components into levels, without the same need for programming expertise.
Anything scalable can make use of performance improvements, so that means production applications with hundreds and thousands of concurrent users is a right example in my experience. Apart from better usability, performance enhancements results directly in greater capital-efficiency(server costs).
My subjective opinion is, the only place I wouldn't consider using Go is when it's garbage collection could hypothetically be harmful(literally) i.e. Say I'm coding a system for a ventilator, I will either go with traditional/proven language for that environment like C or a newer, safer alternative like Rust.
How beautiful would that be; an awesome package manager (Cargo), strong types, blazing fast bare metal performance, safe memory and less strange errors that are hard to debug in an embedded system!
This is what Arduino and Arduino IDE did for millions of hobbyist, but it is time to ditch C/C++ for MicroPython.
In this [1] PyCon talk by Matt Trentini, a demo of QR code generation proves that with plain C and with MicroPython bindings, the performance is identical - 11.5ms. MicroPython is slow, and if the QR code library was written in pure MicroPython, it would take 1500ms. Therefore, it is critical to put performance demanding code in C/C++ modules and compile a MicroPython bindings.
I think this is one of the best things that's happened to embedded development in a long time. Lua is nice but IMO Python is even better :)
There is also Async IO library support for MicroPython. So ISRs can trigger coroutines!
[1] https://www.youtube.com/watch?v=437CZBnK8vI