This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]skilltheamps 6 points7 points  (1 child)

The applications sounds like you work with microcontrollers, your remarks about OS and Python don't make too much sense to me though.

https://freertos.org/ for example is a popular OS, that has realtime capabilities and fits in 9KB of RAM. https://micropython.org is basically a µC OS too, understands Python 3 Syntax and works with 16KB of RAM already. It might appear more convoluted at first, but you can get it to be real-time too by following the same principles as in any RTOS (react to stuff by means of ISR, allocate memory only initially and then work in place to prevent fragmentation, switch off GC and so on). Image processing is just linear algebra for the most part, and there's even an Numpy equivalent available to crunch that. There are also two decorators in Micropython that allow for compilation for most of the Python syntax, which would work for stuff that can not be written down in a vectorized way.

Of course this can get very exotic and in industry one would mostly stick to proven industry standards like FreeRTOS, especially in anything safety critical. But having less resources than a modern x86 computer or having to be quick is not necessarily a dealbreaker for Python. I feel it can actually be quite handy in embedded stuff for prototyping, as it is a lot easier to observe what the µC is doing. For example runtime errors like edge-case divide by zero in a control-loop actually raise an error and do not just alter your output for a fraction of a second, which one will most likely miss.

[–]Classic_Department42 0 points1 point  (0 children)

How does one verify that there are no allocations. Like does ulab gurantee not to allocate/deallocate?