OPT_CPP

Domain: Real Packages

🎯 Motivation

OPT_CPP is a serverless C++ code visualizer that runs entirely in the browser. Students write C++ code, and it shows step-by-step execution with variable values, memory layout, and pointer arrows β€” no installation, no server, just open a URL. It uses WebAssembly (xeus-cpp / clang-repl) to execute C++ directly in the browser.

πŸ“‹ Concrete Example

Visit https://dive4dec.github.io/OPT_CPP/, paste your C++ code, and click β€œVisualize Execution”. The tool compiles the code to WebAssembly, traces each line, and renders an interactive slider-based visualization. It also works offline once loaded.

πŸ”— Analogy

Like a flight simulator for C++ β€” instead of actually flying (running code in a terminal), you sit in a simulator (browser) where you can pause, rewind, and examine every instrument (variable) at any moment. No risk, no setup, just learning.

πŸ”— Connection to jupyter-cpp-tutor

jupyter-cpp-tutor is the Jupyter-embedded version that uses GDB for tracing. OPT_CPP is the browser-based version that uses WebAssembly. Both produce the same visualization style β€” use OPT_CPP for quick demos and exams (no install needed), use jupyter-cpp-tutor for deeper integration in Jupyter notebooks.