Hacker News new | ask | show | jobs
by chrsjxn 1182 days ago
I am very curious about "zero-cost" here? Is this some standard technical term in the rust space?
3 comments

The term comes from C++, where it does have a fairly rigorous definition:

https://en.cppreference.com/w/cpp/language/Zero-overhead_pri...

Although:

https://www.youtube.com/watch?v=rHIkrotSwcc

I'm not sure whether Rust people consistently use it with precisely the same sense.

It’s a term borrowed from C++, a “zero cost abstraction.”

Some folks use “zero overhead abstraction” to try and make the concept a bit more clear, since everything has some cost somewhere. “Zero cost” can feel incorrect.

That makes more sense. Thanks!

Creating and adding DOM nodes is definitely not free, but I can see how this is very low overhead compared to VDOM diffing.

No problem. Here's the primary source, by the way: https://isocpp.org/wiki/faq/big-picture#zero-overhead-princi...

> What you don’t use, you don’t pay for (in time or space) and further: What you do use, you couldn’t hand code any better.

Yes. It's highlighted a lot in rust to mean zero cost abstraction. Basically adding language features without a run time penalty.