(1) not true for embedded and other OS's (2) the hot path is going to be using recycled memory from an allocator in which case the memory is undefined, not 0
-
-
Replying to @andy_kelley @cmuratori and
I think the point of disagreement with the two philosophies is fundamentally what the purpose of a type system is for and what you think it can possibly do.
1 reply 0 retweets 1 like -
Replying to @TheGingerBill @andy_kelley and
For you
@andy_kelley, you want to ensure safety through the type system as much as possible. Which means being explicit on an individual unit. The reason I said "make the zero value useful" is to emphasize the aspect of values rather than types.1 reply 0 retweets 1 like -
Replying to @TheGingerBill @andy_kelley and
The main aspect of what
@cmuratori calls ZII are the following (I might be wrong): It is how [modern] computers work the most efficiently (zero memory is the default), and thus not having to initialize explicitly manually is a lot faster.3 replies 0 retweets 3 likes -
Replying to @TheGingerBill @andy_kelley and
Except oftentimes when you allocate you don't get zero'd memory. You get junk data that you have to clear to zero anyways. Not that clearing to zero is a slow operation usually but it's not the most efficient way to do things in a lot of cases.
3 replies 0 retweets 0 likes -
Replying to @Ada_weird @TheGingerBill and
Programming discussions on Twitter are just so depressing. Clearing to zero is literally free in any case where you would actually have done anything with the data. If you weren't going to do anything with the data, then you couldn't have initialized it to a valid value either.
1 reply 0 retweets 2 likes -
Replying to @cmuratori @Ada_weird and
Not only is clearing to zero free in that case, but _it's also free even if you then initialize it_. The front end eats xors of the same register with itself. They don't even make it to an execution port.
1 reply 0 retweets 4 likes -
This Tweet is unavailable.
-
This Tweet is unavailable.
-
This Tweet is unavailable.
As I said originally, it is _if you are going to be doing anything with the data_. It is never free to initialize memory and then not use it, no matter what you initialize it to, if it wasn't freshly mapped (which was assumed in the thread - that this was "recycled" memory).
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.