4 ms·
Writing truly portable C++ it’s not all that hard. In the worst case you need a handful of ifdefs even if you write systems code.
by adrianN 3y ago
Writing truly portable C++ it’s not all that hard. In the worst case you need a handful of ifdefs even if you write systems code.
- messe 3y ago#ifdefs are a signed of ported code, and not portable code.
- adrianN 3y agoIf you need a few hundred lines of ifdef in a codebase with millions of lines it is portable in the sense that you are able to port it with reasonable effort.
- nindalf 3y agoThat's nice, you're welcome to continue writing your ifdefs. Nothing you or anyone else has said has built a compelling case for alternate frontends. You're saying "it's not much effort". Sure, but I prefer 0 effort. What we're saying is that everyone actually using Rust today is fairly happy with how the language is. That's why Rust has had an 80%+ approval rating among Rust developers since its creation and C++ is at 49% (https://survey.stackoverflow.co/2023/#section-admired-and-desired-programming-scripting-and-markup-languages https://survey.stackoverflow.co/2023/#section-admired-and-de...). This suggestion of alternate frontends still has no good technical reason driving it, just people pattern matching on their past experience. If it happens, all it will do is lower Rust's approval to C++'s level.
- adrianN 3y agoIf only alternative frontends were the only reason that C++ developers were unhappy with the language...
- smaudet 3y agoOnly #if you ignore the hundred other issues with building portable c++ code: * Libraries * ABIs * Build system(s) * Platform compiler support... In compiled/interpreted land, most if not all of these are solved problems. Even for libraries, usually dependencies can be reliably downloaded and recompiled (if they are not compiled on the fly). I don't really care if you can create a "portable header" library when the ecosystem is sharded, and "portable" only holds true for some subset of c++ compiler/platforms.
- adrianN 3y agoThat seems orthogonal to having multiple frontends. I have in fact worked on several systems that compiled under three compilers and ran on multiple architectures and/or operating systems and it was not a hot mess of ifdef spaghetti.
- smaudet 3y agoIts orthogonal to ifdef sphaghetti so long as that's not in support of the (general) sphaghetti. I'm not specifically commenting on ifdefs, because ifdefs are only a small part of the issue (caused by multiple compiler frontends).