3 ms·
You've missed the point in at least two ways. The goal (not the present reality, although it's closer than most) is for the programmer to be able to get a part
by Schroedingersat 4y ago
You've missed the point in at least two ways.
The goal (not the present reality, although it's closer than most) is for the programmer to be able to get a particular program that is 100% defined behavior if they do everything right. Ie. it's a 'there exists' relationship. It's also an aspiration rather than an absolute (ie. make the tools progressively better for that purpose rather than making it an absolute constraint from day 0).
Memory safe languages forbid certain classes of behavior preventing some bugs altogether. Ie. a 'for all' relationship.
The correct behavior on OOM could also be defined as either checking whether allocation succeeded before moving on or as knowing how much memory you need and getting a guarantee it is available. You could be in a state where unpredicted termination has severe negative consequences (mission critical software, resources that need to be cleaned up). By pre-selecting a particular allocation strategy and response to failed allocation, and making it almost impossible to even know when allocation is attempted without reading every line of the massive stdlib you're making it impossible for the programmer to make that choice.