4 ms·
For what it's worth, some "patronizing" limits actually enable optimizations that are otherwise not possible. For example, if anything might be a pointer and y
by JulianMorrison 16y ago
For what it's worth, some "patronizing" limits actually enable optimizations that are otherwise not possible.
For example, if anything might be a pointer and you can point to an offset inside a struct, then you can't have deterministically perfect garbage collection and you can't have garbage collection that moves things, for example to compact the heap. Java solves this by only allowing references to "the top of" objects, and stopping you casting pointers. Consequently, Java's runtime knows what's garbage and it can move things around with impunity.
Or consider Clojure, where immutable data means that you can grab a snapshot of a value without read-locking.