When functions dissolve (2020)
7 days ago
- #functions
- #optimization
- #assembly
- Functions in high-level languages abstract program logic but lose modularity when compiled to assembly.
- Modularity in system design varies from weak (shared address space) to strong (separate processes).
- Subroutines in assembly lack isolated memory, making modularity 'softer' compared to high-level functions.
- Tail-call optimization eliminates unnecessary return addresses, improving efficiency.
- Tail recursion can be optimized into loops, reducing overhead.
- Coroutines generalize subroutines with multiple entry points, appearing in modern languages like Python and C#.
- Assembly code blends functions into a 'soup', reordering and optimizing them beyond their original structure.