I Hacked the JVM to Visualize Algorithms Without Touching the Source Code
Every algorithm visualization tool I've used has the same problem — you have to rewrite your code to use their API. You're not learning the algorithm anymore, you're learning their framework. I wan...

Source: DEV Community
Every algorithm visualization tool I've used has the same problem — you have to rewrite your code to use their API. You're not learning the algorithm anymore, you're learning their framework. I wanted something different. Write normal Java. See it visualized. No SDK, no tracing calls, nothing. So I built AlgoFlow (the engine behind AlgoPad). It supports both Java and Python — this post focuses on the Java side. // This is all you write. Seriously. int[] arr = {5, 2, 8, 1}; arr[0] = 10; // ← automatically visualized @Tree TreeNode root = new TreeNode(1); root.left = new TreeNode(2); // ← tree updates in real time No tracer.patch(0, 10). No visualize(arr). Just code. Why bytecode? The obvious approach for Java would be AST transformation — parse the source, inject tracing calls, compile the modified source. That's what most tools do, and it works fine for simple cases. But I wanted to intercept everything. Every array read. Every array write. Every field mutation on a tree node. Every li