Lua is definitly not the best option, but GC isn't an issue when a real time aware implementation is used.
https://www.ptc.com/en/blogs/plm/ptc-perc-virtual-machine-te...
https://www.militaryaerospace.com/defense-executive/article/...
I thought we were talking about real time GC, besides only the first example is a naval ship.
Hard realtime C++ does as well.
https://researcher.watson.ibm.com/researcher/view_page.php?i...