Re:Lua-RTOS: a real-time operating system for ESP32
by galangalalgol on Wednesday June 09, 2021 @09:53AM
(#27447827)
Both fair points. Hard real-time is absolutely doable with GC if it is deterministic. It has throughput and memory penalties to get low and predictable latencies but it is regularly done. I have written soft real time java myself. And other than avoiding garbage like you would do with any low latency code with GC, it was idiomatic. But that one change does increase cognitive burden to the point I didnt find it any more productive than C++. If I had needed reflection I might have felt differently.
[ Parent
| on HN ]
Re:Lua-RTOS: a real-time operating system for ESP32
by kaba0 on Wednesday June 09, 2021 @10:36AM
(#27448377)
> It has throughput and memory penalties to get low and predictable latencies
Hard realtime C++ does as well.
Re:Lua-RTOS: a real-time operating system for ESP32
by galangalalgol on Wednesday June 09, 2021 @08:32PM
(#27455295)
I've done lots of hard real time c++. It certainly has development time overhead, but the memory usage was the same as idiomatic c++, just everything was preallocated at max usage. No throughput hit either, if anything it was faster because of no allocations.
Re:Lua-RTOS: a real-time operating system for ESP32
by pjmlp on Thursday June 10, 2021 @01:21AM
(#27456952)
Well for the situations that it really really matters, it is rather MISRA-C++, and allocations are not allowed anyway.
Re:Lua-RTOS: a real-time operating system for ESP32
by galangalalgol on Thursday June 10, 2021 @10:37PM
(#27468731)
I've done safety critical that wasn't MISRA. But you have reminded me that for years we were leaving optimization off so we could verify full code and branch coverage in the assembly. At which point Java is almost certainly faster, though we never would have fit in memory with Java. Eventually we started turning optimization on and it was harder to verify but not impossible.