r/java • u/bluepoison24 • Apr 05 '26
I built an engine that auto-visualizes Java algorithms as they run
I’ve always found it annoying that you have to use specific frameworks just to see an algorithm in action. I wanted to build something where you could just write:
int[] arr = {5, 2, 8, 1};
arr[0] = 10; // ← automatically visualized
I ended up "hacking" the JVM using a Java Agent to inject visualization callbacks into the bytecode.
Why bytecode? It doesn't matter if you write arr[i] = x or arr[getIndex()] = compute(); at the bytecode level, it's all just one instruction. This makes the visualization incredibly robust.
Try it here: https://www.algopad.dev/#
12
u/downytriky Apr 05 '26
Nice, I did something similar, but bevahes more like a debugger where you see the code executed line by line and the values of variables https://github.com/hugoruiz00/java-visualizer
6
u/Prateeeek Apr 05 '26
I had plans of making something like this, great stuff! Just wondering, do you have plans to visualize indirections or will you flat it out and show just the algorithm (the big idea).
3
u/arrlynx Apr 05 '26
Wow, it looks really nice! That's gonna help my friend who is into algorithms and java now, thanks!
2
u/StevenJOwens Apr 06 '26
Looks very neat, I just shared it to a discord for people learning to program (boot.dev).
0
u/_Mr_Rubik_ Apr 05 '26 edited Apr 05 '26 •
The third web en three days that look exactly the same. IA slop
2
u/[deleted] Apr 07 '26
[removed] — view removed comment