From 5736cbbeff5ef91b38ee51a89734d13a6b4d47ca Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 13 Dec 2021 12:18:50 -0300 Subject: [PATCH] WIP: understanding stacktraces --- content/thoughts/understanding-stacktraces.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 content/thoughts/understanding-stacktraces.md diff --git a/content/thoughts/understanding-stacktraces.md b/content/thoughts/understanding-stacktraces.md new file mode 100644 index 0000000..ec3d420 --- /dev/null +++ b/content/thoughts/understanding-stacktraces.md @@ -0,0 +1,46 @@ ++++ +title = "Understanding Stacktraces" +date = 2021-11-29 +draft = true + +[taxonomies] +tags = ["programming", "stack traces"] ++++ + +I've seen some people confused when their application crashes, spewing a bunch +of lines and they can't figure out what went wrong. + + + +But let's start with something easier: What are stacktraces? + +## The Turing Machine + +To get what stacktraces are, let's start with the very beginning and talk about +Turing Machines. + +Alan Turing, father of the computing, thought about having a long tape with +commands[^1] and a pointer that would move forwards or backwards according to +the command. + +For example, imagine that you have the following sequence of commands: + +- Take a piece of paper +- Fold it in half +- Unfold +- Move the bottom right corner so it touches the fold mark + +... and so on (no, I'm not describing the whole process of making a paper +plane). Even if the actions are pretty simple, you can use something to point +which action you're taking so you know which one is the next one. Something +like: + +- Take a piece of paper +- Fold it in half +- Unfold **<= I'm Here** +- Move the bottom right corner so it touches the fold mark + +--- + +[^1]: Actually, the Turing Machine would compose a group of 0s and 1s to figure + out a command, but let me simplify things a little bit.