I write C code for AVR8 where the C calling conventions, the stack, etc. are a problem and not a solution. In my mind for relatively simple programs and I can split the program into a few clear layers and if I was writing assembler I could allocate some of the registers to some of the layers (e.g. limited or no flushing of registers in interrupt handlers) and statically allocate RAM ahead of time.
I never get around to switching to assembler because the AVR8 is a dead end and if I really want better performance I can recompile my C code to a much more capable ARM or ESP32.
When I was working on rule-based systems I had this idea of "rules and schemes" where the rules are kept separate from the "schemes" which determine how the rules are applied, what order, etc.
I've thought the idea of separating programs into a core and layers of commentary could be useful in various ways. For instance a language like Rust might have a proof that memory allocation works separate from the main part of the program.