Re:Swift Regrets
by novok on Wednesday September 22, 2021 @03:25PM
(#28620642)
Could you have ODR and proper warnings / errors handling the issue when it pops up without much penalty?
[ Parent
| on HN ]
Re:Swift Regrets
by tialaramex on Thursday September 23, 2021 @03:56AM
(#28626412)
No. ODR allows the compile step to be embarrassingly parallel. Since all the separate definitions of X are, by fiat, identical we needn't detect inconsistency at all and so there's no interaction, it's like merge sorting the files, you can spin up as many threads or processes as you like and process more source files.
If we decide "Oh, but I do want to detect inconsistencies, my users would want me to warn them about that" then we can't have the parallelization because we need to rendezvous constantly to verify the definitions are consistent.
There are a bunch of tricks that people do today to get some semblance of ODR checking for not too high a cost, and to avoid some ODR pitfalls that might defeat the checks they have. C++ programmers have accepted this danger, if you don't like it then C++ isn't the language for you.