Hacker News new | past | comments | ask | show | jobs | submit login

"Zero cost" is a pet peeve of mine. While I concede that the concept is useful, there is always a cost somewhere.

A very concrete example of this was a C++ unit test suite where templates were used to generate several combinations of tasks/backends for verification. At one point our cloud builders ran out of memory. To avoid upgrading the instances at a €€€ cost from all the abstraction, I did some manual type erasure.

So, zero cost typically only concerns run time characteristics. Even then there are elusive pitfalls, like generated code size.




In the Rust community, "zero cost" is pretty widely agreed upon to refer to "zero runtime cost". We're all unfortunately quite aware of the fact that our zero cost abstractions increase our compile times.


AFAIK, no one has even meant "zero cost" to mean "zero compile-time cost".


Not with that very term, but it seems that an important criteria for the Oberon compiler was that any optimization should not make compilation of the compiler slower.

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90....


And yet it is called zero cost. Not "zero cost along one particular dimension that we won't name and only sometimes matters."


We took it from C++ which has a long history with the term; take it up with Bjarne.


Sure he could. And he could take it up with anyone who copies it on a greenfields project too, right? It's a crap name. So what, computing is full of them, assembly language is full of them, C is full of them, C++ is full of them. Sometimes we make a break and don't use one and invent something better. Sometimes...

mov [memory], %register memove(dst, src, size); dst = std::move(src);

eg RAII, SFINAE these are not great names to be copied, I'd be surprised if rust did.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: