Interactive Sandbox

Live Go Code Runner & Playground

Edit code, switch presets, and execute in real-time.

main.go
Go 1.24+ Compiler Runtime
Standard Output (stdout)
Exit Code: 0
Click “Run Program” or select a preset above to execute Go code in the simulated environment.
📊 Allocated: 3 goroutines (6 KB stack) | Execution Time: 104ms
Step-Through Debugger

Interactive Stack, Heap & Variable Stepper

Step through code frame by frame to observe stack allocation, heap escape, pointers, and channel queues in real time.

Execution StepperTopic: Stack vs Heap & Escapes
Mini Playground (static demo)Step 1 / 4
Live execution & memory view will run in-browser (WASM) in the full build. This static demo shows the UX.
x := 10

Allocate x on the stack with value 10.

Stack1 entries
x10
Heapempty
No allocations yet.
Channelsempty
No allocations yet.
Goroutines1 entries
mainrunning
Visual Insights
  • Stack vs Heap: Local variables remain on the stack unless a pointer outlives the creating function frame.
  • Slice Growth: Appending beyond capacity allocates a new doubled backing array in heap memory.
  • Channels: Blocked sends and receives light up immediately until rendezvous synchronization.
Concurrency CSP

Channel Visualizer & Deadlock Detector

Visualize buffered vs unbuffered channels, blocking sends/receives, and concurrent event pipelines.

Channels

Send/Receive Visual Debugger

See buffered vs unbuffered behavior, blocking, and readiness.

Capacity
Channel Statelen=0 cap=2
·
·
Events
No events yet.
Runtime Architecture

Go GMP Runtime Scheduler

Inspect how Goroutines (G), OS Threads (M), and Logical Processors (P) cooperate with work-stealing queues.

Scheduler

Goroutine / M:N Scheduler View

Visualize Ps, run queues, runnable vs waiting goroutines, and dispatch/steal.

Processors (P)2 Ps
P0running
G1
P1idle
no goroutine
Run queue1
G2
Waiting1
G3
Memory Anatomy

Slice Memory Lab & Doubling Strategy

Inspect the 24-byte Slice Header struct (pointer, length, capacity) and watch memory growth algorithms.

Slices

Slice Growth Lab

Append elements, watch len/cap, and see when the underlying array reallocates (generation changes).

Underlying arraylen=3 cap=4
0
1
2
·

Generation (pointer identity): ptr-0x1 (same backing array)

len3
cap4
next append3

Notes

  • • len grows with each append.
  • • cap doubles when len exceeds cap (simplified heuristic).
  • • generation increments on reallocation (pointer changes).
  • • Sharing slices? If generation changes, old aliases break.