40 points · by mkarliner · 3w ago · 8 comments
Can it saturate the adc sampling? Can it configure a 20khz systick? Can it link interrupts together?
How easy is it to stand up uart/i2c/spi concurrently? What about canbus and usb?
How does it handle threaded programs? IS that part of the Node-RED arch? Or maybe micropy?
On the subject of performance, there are really two points - Microcontrollers are now a lot more powerful than they were, although clock speed isn't everything, an esp32s3 runs at 230Mhz and the RP2350(Rp Pico 2) can easily be clocked past 300 and have two cores.
- Also, MicroPython now supports two extra code emitters, Native and Viper, which create native code. They are already used on the spi display driver nodes and layout engine.
So I'm not sure it's as much a toy are you might think it is. OTOH, if this gets take up, I'd look at a lower level language.
Also, with AI somewhat more reliable now, making C/C++ addins is a much more reasonable proposition. Let me get this one tested and being used by folks and I'll think about how to create high speed paths :-)
At the end of the day, I'm trying to aim for use cases that aren't trying to squeeze the last drop of performance, but not toy use cases either.
It's worth remembering that for stuff that really takes some cycles, you can drop down to machine code, like this fft from Peter Hinch. https://github.com/peterhinch/micropython-fourier
A couple of points: - This is not a beginner's tool, it's stated quite plainly on the front page, so I'm not trying to teach people to program.
- In terms of usabiliy, I can only point to the sucess of Node-RED, on which this is closely modelled, and fits in roughly the same niche.
- The state machine point is interesting and well made, I've a long career in coms and OS work, so I fully appreciate your point and will have to think on it.
Thanks for the comments.
ThingStudio, like Node-RED is built with chains of coroutines.
Coroutines and state machines (which I take to mean table driven state machines) are (mostly) functionally equivalent. I'm prepared to take some flame about this :-).
I think most people find it easier to write the pseudo-linear code of coroutines than define formal state machines.
However, a small anecdote is worth relating. Quite a bit of this code was AI generated, and there is a wire protocol between the front and back ends. After a while I was somewhat uneasy that I didn't know enough about this so I ask the AI for a proper human readable doc on the protocol. After watching it thinking for a while, I realised it was trawling through the code. A couple of questions later revealed that my suspicions were correct and the protocol was just free code. I didn't much care for this and told the AI that I wanted it re-written as a table driven state machine. Interestingly, it took a couple of interations before it could grasp the concept properly. And this was one of the current top models. :-)
I tell this story to illustrate that I fully grasp the value of state machines. My first implementation of one was when I made a DSL to define an implementation of X.25 around 1979, so I have some history with them.
The real point to make event driven programming easier.
Tell it what you want, give it access to the COM port or JTAG header, and go have lunch. It'll be working when you get back.
Thanks for making the point. You might want to read this short blog post https://blog.karliner.net/posts/thingstudio-common-ground/
The general point is that yes, you can ask an AI to write this for you, but AI code is notoriously tricky to read. I actually do use an AI to write ThingStudio flows, and I can understand what it produces at a glance. The constrained environment and big functional blocks tend to keep its output crisp and hand editable.