| |
| ▲ | jjmarr 6 hours ago | parent | next [-] | | In my view, this is a good thing. As a C++ developer, I regularly deal with people that think creating a compiled object file and throwing away the source code is acceptable, or decide to hide source code for "security" while distributing object files. This makes my life hell. Rust preventing this makes my life so much better. | | |
| ▲ | pizlonator 6 hours ago | parent [-] | | > As a C++ developer, I regularly deal with people that think creating a compiled object file and throwing away the source code is acceptable, or decide to hide source code for "security" while distributing object files. This makes my life hell. I mean yeah that's bad. > Rust preventing this makes my life so much better. I'm talking about a different issue, which is: how do you create software that's in the billions of lines of code in scale. That's the scale of desktop OSes. Probably also the scale of some other things too. At that scale, you can't just give everyone the source and tell them to do a world compile. Stable ABIs fix that. Also, you can't coordinate between all of the people involved other than via stable ABIs. So stable ABIs save both individual build time and reduce cognitive load. This is true even and especially if everyone has access to everyone else's source code | | |
| ▲ | jjmarr 4 hours ago | parent | next [-] | | > At that scale, you can't just give everyone the source and tell them to do a world compile. Stable ABIs fix that. Also, you can't coordinate between all of the people involved other than via stable ABIs. So stable ABIs save both individual build time and reduce cognitive load. Rust supports ABI compatibility if everyone is on the same compiler version. That means you can have a distributed caching architecture for your billion line monorepo where everyone can compile world at all times because they share artifacts. Google pioneered this for C++ and doesn't need to care about ABI as a result. What Rust does not support is a team deciding they don't want to upgrade their toolchains and still interoperate with those that do. Or random copy and pasting of `.so` files you don't know the provenance of. Everyone must be in sync. In my opinion, this is a reasonable constraint. It allows Rust to swap out HashMap implementations. In contrast, C++ map types are terrible for performance because they cannot be updated for stability reasons. | | |
| ▲ | pizlonator 4 hours ago | parent [-] | | My understanding: Even if everyone uses the same toolchain, but someone changes the code for a module and recompiles, then you're in UB land unless everyone who depends on that recompiles Am I wrong? | | |
| ▲ | at_compile_time 3 hours ago | parent [-] | | If your key is a hash of the code and its dependencies, for a given toolchain and target, then any change to the code, its dependencies, the toolchain or target will result in a new key unique to that configuration. Though I am not familiar with these distributed caching systems so I could be overlooking something. | | |
|
| |
| ▲ | kibwen 4 hours ago | parent | prev [-] | | > At that scale, you can't just give everyone the source and tell them to do a world compile. Firstly, of course you could. Secondly, you don't even need to, as NixOS shows. |
|
| |
| ▲ | Gigachad 3 hours ago | parent | prev | next [-] | | Isn’t this solution solved by just compiling your libraries with your main app code? Computers are fast enough that this shouldn’t be a huge issue. | |
| ▲ | SkiFire13 6 hours ago | parent | prev [-] | | C++ is still changing quite a lot though, just not in ways that fix the existing issues (often because doing so would break ABI stability). | | |
| ▲ | pizlonator 6 hours ago | parent [-] | | That is a reason why a lot of folks stick with C. In some sense, the chasm I'm describing hasn't been crossed by C++ yet | | |
| ▲ | pjmlp 6 hours ago | parent [-] | | Except as you well know, C might not change as fast, but it does change, including the OS ABI. Those folks think it doesn't. | | |
| ▲ | pizlonator 5 hours ago | parent [-] | | > Except as you well know, C might not change as fast, but it does change, including the OS ABI. I don't know that. Here's what I know: the most successful OSes have stable OS ABIs. And their market share is positively correlated with the stability of their ABIs. Most widely used: Windows, which has a famously stable OS ABI. (If you wanted to be contrarian you could say that it doesn't because the kernel ABI is not stable, but that misses the point - on Windows you program against userland ABIs provided by DLLs, which are remarkably stable.) Second place: macOS, which maintains ABI stability with some sunsetting of old CPU targets. But release to release the ABI provides solid stability at the framework level, and used to also provide stability at the kernel ABI level (not sure if that's still true - but see above, the important thing is userland framework ABI stability at the end of the day). Third place: Linux, which maintains excellent kernel ABI stability. Linux has the stablest kernel ABI right now AFAIK. And in userland, glibc has been investing heavily in ABI stability; it's stable enough now that in practice you could ship a binary that dynlinks to glibc and expect it to work on many different Linuxes today and in the future. So it would seem that OS ABIs are stable in those OSes that are successful. | | |
| ▲ | pjmlp 4 hours ago | parent | next [-] | | Speaking of Windows alone, there are the various calling conventions (pascal, stdcall, cdecl), 16, 32, 64 bits, x86, ARM, ARM64EC, DLLs, COM in-proc and ext-proc, WinRT within Win32 and UWP. Leaving aside the platforms it no longer supports. So there are some changes to account for depending on the deployment scenario. | |
| ▲ | anthk 5 hours ago | parent | prev [-] | | The most stable would be FreeBSD with compaNx libraries/modules for old binaries, where N = FreeBSD version number. |
|
|
|
|
|