logoalt Hacker News

daptoday at 3:20 AM1 replyview on HN

I've never once pulled in a new dependency and had the program fail to compile just by virtue of that dependency being present [because both my code and the new code both impl'd the same trait on the same type in some other code]. Because that can't happen because of coherence. (Right?)

It's so easy to forget about the problems we don't have because of the (good) choices people have made in the past.


Replies

dathinabtoday at 2:32 PM

> Because that can't happen because of coherence. (Right?)

yes

Through you still can run into it when unsafe is involved, e.g. C FFI/no_mange or ASM with non-mangled labels as they are globally unique. Through IMHO, it's not a common problem and has ways to make it very unlikely for the projects where it matters.

In the end if you pull in C-FFI code (or provide it) you do ope yourself up to C ABI specific problems.