Writing tiny apps for small constrained systems isn't difficult at all. That's what we did thirty years ago. One neat trick is to use threaded interpretive languages (FORTH).
https://en.wikipedia.org/wiki/Apollo_Guidance_Computer
https://en.wikipedia.org/wiki/IBM_System/4_Pi
https://www.nasa.gov/mission_pages/shuttle/flyout/flyfeature...
The minute you start touching modern languages and OS's things become significantly more difficult to shrink into small platforms.