News for hackers. Stuff that matters.
Re:My experience crafting an interpreter with Rust (2021) by erichocean on Saturday March 25, 2023 @08:54PM (#35309373)
> While the clox compiler does prevent a lot of these cases, it does not prevent stack overflows. The author intentionally decided to skip this check because it would require a lot of boilerplate code. Real-world interpreters using unsafe structures like these must absolutely do it though.

You can do both overflow and underflow checks without any efficiently loss by using virtual memory page faults to "catch" the resulting access (which in any case is a fatal error).

Re:My experience crafting an interpreter with Rust (2021) by loeg on Saturday March 25, 2023 @08:59PM (#35309418)
Only if under/overflow can be bounded. E.g., with stack probing.