Why not have the compiler take a program like this:function a(b) { return b^2 };function c(b) { return a(b) + 5 };and convert it into a program like this:function c(b) { return b^2 + 5 };thereby eliminating the computer's need to remember c(b)'s return address?I suppose the increased hard disk space and RAM needed to store the program and support its compilation (respectively) is the reason why we use call stacks. Is that correct?
Why do programs use call stacks, if nested function calls can be inlined?
compiler;stack;code generation;calling conventions