optimization - Why bother allocating activation records at runtime when you could perform an inline expansion of all recursive function definitions at compile time? -


note have read question

why not mark inline?

and

can recursive function inline?

yet still feel there unresolved edge case of interest here. assume language has following:

  1. pure first-class functions parameters treated constants (no write-back)
  2. anonymous inline functions supported (lambda abstraction)
  3. callbacks/continuations/coroutines/fibers patterns
  4. tail-call optimisation
  5. macro expansion

then why bother allocating activation records @ runtime when perform inline expansion of (mutually) recursive function definitions @ compile time? seem reduce calling overhead zero, open opportunities parallel 'simplification' of expressions abstracted behind each functions using standard computer algebra techniques variables can remain unknowns during symbolic reduction - including evaluating multiple branches of condition speculatively , throwing away valid result (something made difficult von neumann bottleneck imposed stack-based approach).

i appreciate not optimisation expand in-place recursive function invocations code-bloat not able take proper advantage of cpu's cache, only interested in using features mentioned in 3. feel pragmatic of limited depth.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -