3 ms·
I mean, a sufficiently safe language would rule it out. Either one not expressive enough to express memory unsafety (i.e. GC or fully linear types with no escap
by andrewflnr 1y ago
I mean, a sufficiently safe language would rule it out. Either one not expressive enough to express memory unsafety (i.e. GC or fully linear types with no escape hatches) or one that requires a machine checked proof of safety to compile. These options just happen to be too big of a pain in the assembly for today's appetite.
- api 1y agoThere are lots of languages where true memory bugs are impossible. As you say they are higher level and usually GC.
- andrewflnr 1y agoRight, the interesting case would be the formal proof. Though, I suspect there are fewer high-level languages where memory bugs are actually impossible than you would naively think. I've segfaulted Python by accident, only using the standard library (concurrency shenanigans if I recall). You can probably do worse if you try. To make a truly memory-safe language, you would need to carefully design and implement the standard library, disallow all native code extensions, and probably more I'm not smart enough to figure out. So, not Java, not Python. Maybe some Schemes?