The point of ZII is that it is the right condition to use, because app memory is always zero on allocation, and thus by definition if you structure the program this way, you have no overhead while still having initialization determinism.
-
-
Replying to @cmuratori @Lokathor and
(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
1 reply 0 retweets 2 likes -
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 -
Replying to @cmuratori @Ada_weird and
Twitter is a poor format for any discussion of any complexity. This discussion's format is better expressed in speech, or at least a long form email.
1 reply 0 retweets 0 likes -
Replying to @TheGingerBill @Ada_weird and
Also I feel like people have to actually learn about CPUs before arguing about something low-level like this. And you need to talk about what the basis is - like are we talking about a modern OS+CPU (ARM, x64, Windows, iOS, whatever) or are we talking about a 6502, etc.
2 replies 0 retweets 4 likes
I feel like this is a case where people are arguing about something based on a model of how computers work that has not been true for over a decade.
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.