Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Visual Brainfuck Interpreter (dyer.me)
60 points by frpzzd on May 17, 2020 | hide | past | favorite | 12 comments

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 , repo here: 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.

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.

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

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

Hm. What browser are you using?

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

One of recent Firefoxes, on Windows.

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

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.

You should be able to find an appropriate one for your purposes somewhere in here (https://esolangs.org/wiki/Main_Page). Befunge and PATH come to mind.

Introduce it as an anonymous "more human friendly" notation for Ook! https://esolangs.org/wiki/Ook%21

Bequnge is a graphical environment for befunge. Uses Qt for front end so it's fast and runs anywhere. It's no longer maintained and it crashed once or twice on me though

Applications are open for YC Winter 2022

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact