
I made a debugger that draws the state machine of the program - r00nk
http://i.imgur.com/PINcCUy.gif
======
jacquesm
That is absolutely awesome. I used to have something like this: a pair of very
fast dacs hooked up to the 16 address lines of my computer and another dac
hooked up to the databus. It allowed me to look straight into the memory of
the machine as the processor was accessing it, quite a powerful tool. Yours is
nicer though (and with todays memory size I'd hate to think about the quantity
of data that passes in a split second across the bus of a modern pc).

~~~
arethuza
That reminds me of the old story of people having a audio speaker connected to
the address but of their mainframe so they could detect error conditions by
the sounds being made.

~~~
whitten
As I recall, it was a radio that was tuned to the Kilohertz band. This was
before the FCC was so careful about computers emitting radio waves. A computer
that has a clock cycle measured in Kilohertz can emit radio waves in the
Kilohertz band.

This makes "music" of a sort, especially when the program running does many
things repetitiously. In the early days of computing, multiplication was
implemented as repeated addition. Memory access also had a particular pattern
of repetitive circuitry.

This provided a base repetition that humans recognize. When code was stuck in
a loop, or repeatedly accessed the same range of memory locations, the
operators could hear the pattern and know something was wrong.

~~~
ansible
That reminds me of the time I was poking (literally POKE'ing) around with my
TRS-80 Color Computer. I (somehow) had changed it to one of the graphics modes
and then set the base address to the start of RAM.

So on the screen you could sort of see the BASIC stack, other important system
variables, and even a squashed representation of the text console. So when it
was sitting idle you'd see one kind of pattern, and running programs produced
other kinds of patterns.

Fun times.

------
rmc
Here's one for Python. [http://pythontutor.com/](http://pythontutor.com/) It
shows the variables, and allows you to step forward and backward. Great for
explaining programming to new people who haven't grokked computing yet.

~~~
nailer
Apple Swift and Unreal Engine Blueprint both have amazing state visualization
tools built in. See:
[https://docs.unrealengine.com/latest/images/Engine/Blueprint...](https://docs.unrealengine.com/latest/images/Engine/Blueprints/UserGuide/Debugging/debugging_editor.jpg)

I think a deep visual debugging tools are going to be 'built in' in future in
much the same way that HTTP primitives were recently with node and string
manipulation was with Python 2.

~~~
hyp0
There used to be an IDE called "Together" that supported bi-directional
transformation between source code and diagrams.

Although it sounded like a really cool idea, it didn't take off. Seems text is
best (maybe because it supports incompatible hierarchies better).

~~~
cLeEOGPw
Text probably serves better because code is often too complex to visualize in
some cases, and in others to comprehend generated visualized code.

Think about algorithm that switches values by using temporary variable for
example. By looking at text, it's pretty simple to construct the flow follow
the values traveling from one variable to other. But if you put it in 2D
graphical interface, it becomes very problematic and hard to follow. I would
imagine it would be easier if there was like a movie where value would move
from one box symbolizing variable to other. But that would make it difficult
to edit.

Another way would be to visually represent only change, but then it would be
same as textual representation, only more redundant.

~~~
r00nk
Actually I can think of a simple way to visualize that.

The debugger actually displays what I call a folded lattice, meaning that
execution starts at the top and goes down, so representing what your talking
about would simply look like ">" with lines. It would need some representation
of data flow, however, which it currently doesn't have.

------
r00nk
Also, if anyone's interested, I need some help porting it to different
platforms. If you can swim in the clusterfuck of x86 for a bit to port it to
ward that would be awesome, or even getting working with gdb this could be an
actual tool.

~~~
r00nk
might as well attach a src link here too:
[https://github.com/r0nk/ward](https://github.com/r0nk/ward)

------
r00nk
source: [https://github.com/r0nk/ward](https://github.com/r0nk/ward)

~~~
desdiv
I'm slightly saddened that Github doesn't recognize Brainfuck files.

~~~
Argorak
Of course it does:

[https://github.com/r0nk/ward/blob/master/hello.bf](https://github.com/r0nk/ward/blob/master/hello.bf)

[https://github.com/github/linguist/blob/master/lib/linguist/...](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml#L327-L332)

Just not in Ace (their code editor).

It doesn't count it in language statistics, though.

~~~
gjtorikian
Hmm, this looks like a different issue. Brainfuck _is_ recognized in the
stats, if you head to search:
[https://github.com/r0nk/ward/search?l=makefile](https://github.com/r0nk/ward/search?l=makefile)

It's not showing up in the color bar, though. Loggin' dat issue.

------
hrjet
IIUC, you could probably use KLEE to ease the pain of capturing the state.

[http://klee.github.io/](http://klee.github.io/)

------
simias
I would have been more interested by the source code and some explanations...

~~~
MichaelMoser123
shameles plug for my little project - the pooh programming language:

[http://mosermichael.github.io/cstuff/all/pooh-
lan/2012/12/11...](http://mosermichael.github.io/cstuff/all/pooh-
lan/2012/12/11/pooh-intro.html)

here you can get an execution trace of the program: each expression is
displayed as it evaluates:

[http://mosermichael.github.io/cstuff/docs/html/pooh/example/...](http://mosermichael.github.io/cstuff/docs/html/pooh/example/02-fact.p.html)

(they used to have something like that in some scheme interpreters, i used
this featue a lot at the time)

~~~
r00nk
hey the projects open source, if you can add your language to ward then it
might help your language have a unique IDE, It'll have something other
(excluding bf) languages don't have.

------
dschubert
Shameless self-plug: Me and a friend developed a Java debugger [1] that
visualizes (Java) programs with UML class and sequence diagrams [2]. It isn't
actively developed anymore, but the demo version [3] (along with Help ->
Tutorial) can still be used to give it a try.

It was quite an involved & fun project as we used Java VM Tool Interface
directly instead of using JDI and the layout algorithms for the diagrams are
quite fancy too :)

[1] [http://www.jbixbe.com](http://www.jbixbe.com) [2]
[http://www.jbixbe.com/VisualTour.html](http://www.jbixbe.com/VisualTour.html)
[3]
[http://www.jbixbe.com/download/jar/jbixbe.jar](http://www.jbixbe.com/download/jar/jbixbe.jar)

------
avodonosov
That's useful, exactly the tool missing in my BrainFuck toolkit.

+1

------
PhasmaFelis
All right, I'll be the first one to admit that I don't know what the hell I'm
looking at. Would some sort of explanation, or at the very least some source
code, be too much to ask?

------
VLM
Its interesting that its dynamic. Idea to think about would be snapshotting
dot files for graphviz. Then you can do all kinds of crazy stuff with the
graphviz output.

My databases at work snapshot out their schemas to graphviz to create diagrams
of all the FK relationships automatically every day, which I find helpful, and
more or less inspired this idea.

------
clarry
I would love to have a visual representation of all the possible branches that
can be taken in a body of C code, with an easy way to ask the program to tell
me what are all the conditions that must be met for this branch to execute.

~~~
r00nk
Yeah that was the idea, I'm posting it around to see if I can get a few folks
interested in porting it to different languages. Maintaining everything is
hard on a one man teenage team.

------
c-qjv0xfi
What is the widget in the top right corner? What WM are you using?

~~~
r00nk
WM cwm, the widget is just my conky setup, here are my dotfiles:
[https://github.com/r0nk/configs](https://github.com/r0nk/configs)

~~~
jaskerr
Are you using OpenBSD, or one of the Linux ports (Neukirchen?)?

~~~
r00nk
Arch linux

------
partition
How did you get your terminal to look like that?

~~~
michaelx386
The font looks like Terminus. The background transparency effect and hidden
scrollbars can be set-up with most terminals, this one is probably urxvt. As
for the borderless/undecorated window, that's probably done via the Window
Manager. DWM[0] for example doesn't paint window decorations but there's
usually a way to set this up in Gnome/Unity/KDE/etc as well.

[0] [http://dwm.suckless.org](http://dwm.suckless.org)

~~~
partition
Thanks!

~~~
r00nk
also, here are my dot files:
[https://github.com/r0nk/configs](https://github.com/r0nk/configs)

------
faaar
what wallpaper is that

~~~
cyann
Looks like a screen cap from the BioShock game

[http://en.wikipedia.org/wiki/BioShock_%28series%29](http://en.wikipedia.org/wiki/BioShock_%28series%29)

~~~
Lutin
It's concept art from the creation of BioShock 1

[http://bioshock.wikia.com/wiki/File:1959.jpg](http://bioshock.wikia.com/wiki/File:1959.jpg)

