Skip to content

Stack Pollution #137

Answered by h3rald
ghost asked this question in Q&A
Feb 2, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Well, it's something I introduced relatively recently as an effort to make min programs easier to reason about and less error prone.

While you could just keep putting things on the stack and use it to manage state, typically I noticed that it causes more harm than good, and it's much better to be 100% sure that a file you are requiring doesn't add extra elements to the stack.

I tried using min without stack pollution checks, signatures and requires (and you can still can just using lambdas), and it was much harder than it is now I must say: I can now read a program days/months later and understand what it does. But if I look at something like this (which I have to update and refactor soon…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant