
Show HN: Visual Brainfuck Interpreter - frpzzd
https://franklin.dyer.me/htmlpage/brainfuck.html
======
maweki
I did some visualization of brainfuck quite a few years ago. I do an
interpretation and generate a pov-ray script that generates frames that
generate a video.

Multiplication here:
[https://www.youtube.com/watch?v=6PIZTFrkl0w](https://www.youtube.com/watch?v=6PIZTFrkl0w)
, repo here:
[https://github.com/maweki/brainfuck2video](https://github.com/maweki/brainfuck2video)

The problem I find with basically every brainfuck visualization (mine
included): it's only useful with a few memory cells as the tape becomes full.
You can't skip over or fast forward specific "widgets" (I've seen
multiplication, now move along). At that point, you could find other levels of
abstraction and try to allow for some macros that should always take x
seconds, independent of the number of actual operations.

And I think most projects would be well-served using some simple termination
arguments to prevent some simple not so well-behaved programs (of course, this
is in general undecidable). But this shown interpreter for example, just does
nothing on "+[]" but whether some program in some state is quiescent is easily
decidable.

------
frpzzd
A Brainfuck interpreter that shows how the cellular automaton behaves as your
code runs. A description of the language and some challenging puzzles can be
found below.

~~~
thethirdone
In case you are not aware, there are quite a few people who have done pretty
crazy things with brainfuck. For example, there are some really short quines
[0], brainfuck compilers and interpreters in brainfuck, and a multitude of
macro languages to make writing bf programs faster.

Writing a quine is a decent challenge. you should add that as a final
challenge for when you have done the others.

[0]:
[https://github.com/itchyny/brainfuck/blob/master/quine3.bf](https://github.com/itchyny/brainfuck/blob/master/quine3.bf)

------
huhtenberg
There's something wrong with the status (?) widget at the top of the screen.
Here's what I get trying to run a sample .b script -
[https://imgur.com/EEcZDym.png](https://imgur.com/EEcZDym.png)

~~~
frpzzd
Hm. What browser are you using?

~~~
Narishma
Not OP but I have the same issue in Firefox on Windows.

------
russfink
I wish the name wasn't NSFW. OR not safe for teaching kids about programming
in mimimalist environments.

~~~
frpzzd
Yes, that is regrettable. Whenever I talk to someone about BF, they tend to
assume I’m just looking for an excuse to cuss.

One time I took a math/number theory class in which the professor had us prove
all sorts of theorems but never told us their names (presumably because he
didn’t want us looking them up). Depending on the context in which you’re
teaching, you might try something like that - if one of your students were to
look up the language and discover that it’s called “Brainfuck” on their own
time, you wouldn’t be to blame.

On the other hand, depending on who you’re teaching, the name “Brainfuck”
might actually serve as an intriguing hook that captures the attention of
less-mature audiences. To be perfectly honest, the clickbait-y nature of the
name “Brainfuck” is probably why I discovered the language while surfing
Wikipedia in the first place.

