Skip to main content
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 ...
Eric Lippert's user avatar
  • 4,136
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. ...
Starship's user avatar
  • 1,356
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....
Matthieu M.'s user avatar
  • 3,549
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 ...
Michael Homer's user avatar
  • 13.6k
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 ...
Olive's user avatar
  • 470
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++ ...
Matthieu M.'s user avatar
  • 3,549
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 ...
Chris Dodd's user avatar
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 ...
Michael Homer's user avatar
  • 13.6k
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 ...
Gavin D. Howard's user avatar
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 ...
Matt Timmermans's user avatar
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 ...
André L F S Bacci's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible