3 ms·
> In my opinion zero-cost abstraction is nothing but a catchy meme. It has a specific meaning: an abstraction which compiles to the same machine code as a low-
by tetromino_ 10y ago
> In my opinion zero-cost abstraction is nothing but a catchy meme.
It has a specific meaning: an abstraction which compiles to the same machine code as a low-level, unsafe, non-generic C-like implementation would. Without any additional pointer accesses or sanity checks required at runtime. The canonical example would be an iterator over a vector which compiles to the same machine code as a traditional C for loop.