4 ms·
Out-of-bounds indexing is always fun. I'm interested in programming languages with mostly-watertight spatial memory safety, which can prevent many exploits at a
by nyanpasu64 4y ago
Out-of-bounds indexing is always fun. I'm interested in programming languages with mostly-watertight spatial memory safety, which can prevent many exploits at a minimal ergonomic/flexibility cost, compared to temporal memory safety which requires a borrow checker and endless compiler complexity (plus I find it easier to statically verify you don't use-after-free in the limited code interacting with resource lifetimes, than index out-of-bounds in the majority of business logic interacting with arrays).
- staticassertion 4y agoGoogle just published that 50% of exploited vulnerabilities in Chrome are Use After Free, so I'm very bearish on the "temporal safety will be enough" thing being pushed. Temporal safety does not require a borrow checker etc, you can use a GC and get it.
- selfmodruntime 4y agoAny language can implement safe vector / array accessing with a `get` call returning either a sum type of throwing an exception when the element does not exist at the index. Quite frankly, manually indexing into an array should be entirely avoided if possible, even more so with safety critical software.
- GoblinSlayer 4y agoIt's easier to name languages without ergonomic bound checks: Assembler and C. They were done in STL for ages, but only in debug mode, which makes them useless, but it's not a technical problem.