Every program compiled with a reasonable compiler runs putting some of its data in the so called stack. It’s fairly easy: when you call a function, the function puts its data on top of the stack; when the function returns the data is removed so that the stacks now exposes the data of the caller function. In this post we mess with this mechanism, but substituting the default area of memory for the stack with a freshly allocated one.
Mostly because I just wanted to understand a bit more how these things work. Using abstraction in the form of magic keywords gets the job done (sometimes, but not always) but is almost useless for your understanding.
And I think that the understanding can be very useful even when you use the magic words.
5 comments
[ 2.8 ms ] story [ 23.5 ms ] threadAnd I think that the understanding can be very useful even when you use the magic words.
[1]: https://ziglang.org/documentation/0.5.0/#newStackCall
[2]: https://ziglang.org/download/0.6.0/release-notes.html#newSta...