I've been meaning to write this down for a long while, but i've made it a youtube essay instead, as an experiment, to learn something new; so: what the hell is the problem with monads?

I've been meaning to write this down for a long while, but i've made it a youtube essay instead, as an experiment, to learn something new; so: what the hell is the problem with monads?
AKA Learn You A Brainfuck For Great Good
As part of the Advent of Code, my challenge has been to try and solve several of the puzzles using Brainfuck: a minimalist esoteric programming language with only 8 instructions. I wrote at length about this process (and how i use a custom transpiler to save myself from having to having to copy and paste snippets of unreadable gibberish) in this earlier post.
Last night, i have completed what is probably going to be my last attempt of the year: part 1 of day 9. The resulting file is monstrous: 296261 instructions, that took six and a half hours to run after compiled by an optimizing compiler (bfc), and i had to tune the compiler's option for it not to segfault... Turns out bubble-sorting 11k+ elements in brainfuck is slow, who would have thought? :D
And since this was such a challenge, i thought i'd write a quick something about how i wrote this monstrosity, and how to write brainfuck programs in general.
So. I like Brainfuck. I find the challenge of writing code in it fun / fascinating. And a few years ago, i figured out an "easy" way of writing code with it: using it like Forth, by using the tape like a stack.
The idea was as such: treat everything on the "left" of the current position as data; treat everything on the "right" as empty space that can be used for temporary computations and to which the stack can extend. This formalism makes it easier to reason about what's happening, and therefore easier to combine simple snippets into a bigger program. For instance, the following code doubles the current value at the top of the stack, in two steps:
duplicate the current value
[->+>+<<]>>[-<<+>>]<
add the current value to the previous one
[-<+>]<
Turns out day 6 was easy! It proved to be a good opportunity to actually try writing some brainfuck directly, without the transpiler! I've tried commenting the code as much as possible to make it as readable as brainfuck code can be:
So. I like Brainfuck. I find the challenge of writing code in it fun / fascinating. And a few years ago, i figured out an "easy" way of writing code with it: using it like Forth, by using the tape like a stack.
The idea was as such: treat everything on the "left" of the current position as data; treat everything on the "right" as empty space that can be used for temporary computations and to which the stack can extend. This formalism makes it easier to reason about what's happening, and therefore easier to combine simple snippets into a bigger program. For instance, the following code doubles the current value at the top of the stack, in two steps:
duplicate the current value
[->+>+<<]>>[-<<+>>]<
add the current value to the previous one
[-<+>]<