In one memorable project the hardware guys grudgingly agreed to waste money and give the system enough resources to run Linux.
But they chose a cheaper ARM CPU without a MMU or hardware floating point. That meant it would not run shared libraries, everything was statically linked. We ran out of space in the Flash, and the project was in crisis. The solution was using a lua interpreter.
These days, I like high level platforms like Nerves: https://www.nerves-project.org/