6
votes
How do interpreters avoid stack buffer overflow-related undefined behavior and exploits?
If you're interested in how these sorts of things were done in ancient times, I wrote the stack probing code for VBScript and JScript back when it was the 1990s. Which was complicated by the fact that ...
5
votes
What are the benefits of stackful vs. stackless coroutines?
Stackful
Here are some pros:
More control. There is more control over the execution state which lets us have more flexible coroutine interactions and more complicated control structures.
...
4
votes
What are the benefits of stackful vs. stackless coroutines?
Disclaimer: There are multiple implementation techniques for both stackful and stackless coroutines, each with their own strengths/weaknesses. I do not promise to consider all possible implementations....
4
votes
Accepted
Pros and cons of reifying the stack in an interpreter
Reifying the stack makes implementing lexical capture significantly easier, but has real performance costs. It can also enable (relatively) easy extension to coroutines or other language constructs ...
4
votes
Pros and cons of reifying the stack in an interpreter
I find recursive evaluation (a.k.a. ones that "piggyback" the host language's call stack) to be more readable and much easier to implement. The obvious disadvantage is that, for a large ...
3
votes
How do interpreters avoid stack buffer overflow-related undefined behavior and exploits?
As far as I know, there is no perfect way to handle stack overflows at lower level (C, C++, Rust)
There are ways, it's just a matter of cost -- code-size and run-time performance -- C and C++ ...
3
votes
How do interpreters avoid stack buffer overflow-related undefined behavior and exploits?
As far as I know, there is no perfect way to handle stack overflows at lower level (C, C++, Rust)
While there's no way at the language level (at least for C/C++, not sure about rust), you can go ...
3
votes
Accepted
How do interpreters avoid stack buffer overflow-related undefined behavior and exploits?
It’s not difficult at all for an interpreter to set a hard cap on stack size that is well within what the system can support, and they do. Platform stack size limits are no longer at a level where ...
2
votes
Pros and cons of reifying the stack in an interpreter
@Olive's answer is exactly correct, but as someone who implemented a non-recursive interpreter, I had one more reason for doing so: the interpreter becomes a simple dispatch loop.
There are a few ...
2
votes
What are the benefits of stackful vs. stackless coroutines?
"Stackful" coroutines, as implemented to today in Go and Java, are a generally superior technology that requires lower-level control over the execution environment.
They have two huge ...
1
vote
Alternatives for stackless async I/O implementation?
Truly stackless
Let's start with call stack frames. These are a very convenient invention that enables automatic temporary storage in a very compact form. This was paramount on early machines where ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
call-stack × 5interpreters × 2
async × 1
functions × 1
calling-conventions × 1
undefined-behavior × 1
coroutines × 1
history × 1
io × 1
concurrency × 1