Call stack
A call stack is a runtime LIFO structure that tracks active function or method calls, including their execution contexts and return information.
Rust in Action: Systems programming concepts and techniques
A call stack is the runtime structure that records active function calls, their local data, and the points to which control returns.
- How it is used
- Uses the call stack to explain function control flow, memory choices, and recovery from deeply nested calls.
- How deep it goes
- Implements return-address storage in a CPU emulator and explains unwinding, while using only a minimal exception handler.
- Examples
- Illustrates recursive depth printing and a CHIP-8-inspired CPU emulator with call and return operations.
- What you can do after
- Build a simplified CPU call stack and evaluate how ordinary returns differ from a nonlocal jump.
Read how Rust in Action: Systems programming concepts and techniques explains call stack →
100 Go Mistakes and How to Avoid Them
A call stack is the runtime-ordered sequence of active function calls through which control returns during execution.
- How it is used
- Explains function frames as a foundation for understanding Go allocation and optimization.
- How deep it goes
- Traces frame creation and removal, then explains escape-analysis rules and how to inspect compiler decisions.
- Examples
- Traces a sumValue call and contrasts returning a pointer to a local variable with passing pointers into a callee.
- What you can do after
- Diagnose allocation decisions with Go compiler escape-analysis diagnostics.
Read how 100 Go Mistakes and How to Avoid Them explains call stack →
Go in Practice, Second Edition
A call stack is the runtime structure that records active function invocations and their execution contexts.
- How it is used
- Uses goroutine-local stacks to explain concurrent request handling and the boundary required for panic recovery.
- How deep it goes
- Explains stack creation, unwinding, and recovery boundaries, but stops short of runtime implementation details.
- Examples
- Demonstrates an echo server, a panicky response, an HTTP handler, and a reusable goroutine recovery wrapper.
- What you can do after
- Diagnose goroutine crashes and add deferred recovery at the correct function-stack boundary.
Read how Go in Practice, Second Edition explains call stack →
Grokking Algorithms, Second Edition
A call stack is a runtime stack that stores information for active function calls, including their execution state and local data.
- How it is used
- Tracks active function calls and preserves paused execution while functions call other functions or recurse.
- How deep it goes
- Explains push, pop, saved variables, recursive growth, and stack-height costs, but defers tail recursion.
- Examples
- Uses sticky-note tasks, nested greetings, recursive factorial, recursive search, and quicksort pivot choices.
- What you can do after
- Diagnose/debug with it: trace nested calls, identify paused execution, and recognize excessive stack growth.
Read how Grokking Algorithms, Second Edition explains call stack →
Functional Programming in JavaScript
A stack of execution-context frames used by JavaScript to manage nested function calls and their associated execution state.
- How it is used
- Explains how JavaScript manages function calls and analyzes performance costs from nested execution.
- How deep it goes
- Explains LIFO behavior, frame contents, memory growth, and nested-call costs without detailing the complete runtime specification.
- Examples
- Uses logger invocation, curried addition, unbounded recursion, and recursive longest-string search to illustrate stack behavior.
- What you can do after
- Diagnose stack-related performance problems by relating nested calls, currying, and recursion to execution-frame growth.
Read how Functional Programming in JavaScript explains call stack →
Secrets of the JavaScript Ninja, Second Edition
A stack-like runtime structure that records active execution contexts for nested calls and returns.
- How it is used
- Tracks active and waiting JavaScript execution contexts as nested calls pause and resume.
- How deep it goes
- Defines stack behavior and traces nested calls through returns without detailing execution-context internals.
- Examples
- Traces skulk calling report, followed by separate skulk calls with Kuma and Yoshi.
- What you can do after
- Understand which execution context is active as function calls nest and return.
Read how Secrets of the JavaScript Ninja, Second Edition explains call stack →
Python How-To
A call stack is a runtime structure that records active and underlying function or method calls in execution order.
- How it is used
- Uses the execution context stack to explain traceback generation and locate the operation that causes an exception.
- How deep it goes
- Explains call order and traceback reading, but stops short of runtime frame internals or stack-memory implementation.
- Examples
- Uses a Task method typo to trace an AttributeError from update_urgency to the invalid update_db call.
- What you can do after
- Diagnose/debug with it by reading the final traceback call, locating the faulty line, correcting the definition, and rerunning the script.
Build a Frontend Web Framework (From Scratch)
The runtime stack of active JavaScript execution contexts used to track currently executing calls.
- How it is used
- Coordinates synchronous calls and queued callbacks while scheduling component lifecycle hooks.
- How deep it goes
- Defines push and pop behavior and explains stack emptiness, but limits event-loop treatment to simplified browser steps.
- Examples
- Uses mountDOM(), onMounted(), fetch(), async/await, promise callbacks, and the browser event-loop cycle.
- What you can do after
- Evaluate when synchronous code, lifecycle callbacks, tasks, and microtasks execute during browser scheduling.
Read how Build a Frontend Web Framework (From Scratch) explains call stack →
Also covered in
- Akka in Action, Second Edition
- C# Concurrency: Asynchronous and multithreaded programming
- 100 Java Mistakes and How to Avoid Them
- The Well-Grounded Python Developer: How the pros use Python and Flask
- Code Like a Pro in Rust
- Functional Design and Architecture: Examples in Haskell
- Fabulous Adventures in Data Structures and Algorithms
- Systems Programming with ZigIn early access (MEAP)
- The Well-Grounded Rubyist, Fourth Edition
- Julia as a Second Language
- Grokking Data Structures
What to know first
- memoryMemory is a storage capability or mechanism for retaining information or computational state for later access or use.
- data structureA data structure is an organized representation of data and its relationships that supports defined operations for storing, accessing, or modifying it.
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- memory allocationMemory allocation is the process of reserving or assigning computer memory to hold program data or objects.
Related concepts
- stackkind of · A stack is a last-in, first-out data structure in which elements are added and removed at the same end.
- stack traceused by · A stack trace is a diagnostic record of the active or recently unwound function or method calls at a point in program execution, often including source locations.
- drop frameused by · A debugger operation that removes active call-stack frames to return execution to an earlier call, allowing that call to be run again.
- first-in-last-out structureuses · A first-in-last-out structure follows an ordering rule in which the most recently added item is the first retrieved, processed, or removed.
- heapcontrasts with · A heap is a runtime memory region from which dynamically allocated data is obtained and whose allocation and lifetime are managed separately from function call frames.
- recursionused by · Recursion is a computational technique in which a definition or procedure refers to or invokes itself, directly or indirectly.
Questions about call stack
What is call stack?
A call stack is a runtime LIFO structure that tracks active function or method calls, including their execution contexts and return information.
Which Manning books explain call stack?
Rust in Action: Systems programming concepts and techniques, 100 Go Mistakes and How to Avoid Them, Go in Practice, Second Edition, Grokking Algorithms, Second Edition, Functional Programming in JavaScript, Secrets of the JavaScript Ninja, Second Edition, Python How-To and Build a Frontend Web Framework (From Scratch).
What should I know before learning call stack?
Manning books that teach call stack usually introduce memory, data structure, function and memory allocation first.
What is the difference between call stack and heap?
A call stack is a runtime LIFO structure that tracks active function or method calls, including their execution contexts and return information. A heap is a runtime memory region from which dynamically allocated data is obtained and whose allocation and lifetime are managed separately from function call frames.
What is call stack a kind of?
Call stack is a kind of stack. A stack is a last-in, first-out data structure in which elements are added and removed at the same end.
What is call stack also called?
Call stack is also called execution stack.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







