[0]: https://github.com/micropython/micropython/tree/master/lib/r...
https://docs.micropython.org/en/latest/library/re.html
so alternatives to provide additional features have been discussed... Either extending the existing module or swapping to a more feature-rich library. Possibly even doing so for larger micros that can afford the additional flash/memory, though that makes support more challenging.
The engine chosen by MicroPython is vulnerable to catastrophic backtracking and switching to the Pike VM implementation would fix that. Instead of backtracking in the text when the pattern doesn't match, the Pike VM iterates each char in the text only once, visiting the states valid for that position in lock step. Consequently, it allocates a list of “thread”s, proportional in length to the number of states in the pattern (though usually patterns have relatively few states). Many security issues have resulted from regexp denials of service, so this slight memory tradeoff might be worthwhile.
Since recursiveloop.c has been changed by MicroPython, those changes would need to be ported to pike.c. The fixes are small and none of the extra features exploit the backtracking, so this should be easy.
I learn all languages that I find interesting, even if I don't use them, because I am a systems programming nerd, in languages, graphics and operating systems.
So it is always interesting to have an understanding of what Rust is all about, even if I will never work professionaly with it.
We used DATA blocks, now they can use @micropython.asm_thum.
We were able to already do so much on home computers back in the day, in an interactive development enviroment, no need to reach out for C in hardware that is x times better than those home computers.
Exciting!
I'm never going back my old standby (C on an NXP LPC4). This is the new normal and it's fantastic. I'm really excited to see ROMFS working on this part soon.
Adafruit did an incredible job putting all that abstraction across their products into a single "import board" statement.
est•2mo ago
analog31•2mo ago
I also don't know how much of the more advanced optimizations of Python are built into MicroPython. There's always a dilemma between making it performant, and making it micro.
matt_trentini•2mo ago
The challenge is that MicroPython has many fewer standard libraries:
https://github.com/micropython/micropython/wiki/Standard-Lib...
And so many Python libraries targeting CPython won't work out-of-the box and you'll need to modify them or use alternatives that do work on the MicroPython subset.
jononor•1mo ago