by dathinab · 5y ago · 0 comments
But wow is that a multiple degrees more complex then in most other languages.
You're not gonna use Rust or Zig to write code for some obscure DSP CPU with a ridiculous architecture and no OS.
Of course with no OS you can't run Rust's standard library as this expects OS services to underpin it. But you can have core features, and if you've got "no OS" you presumably were expecting to write anything you needed anyway.
The reality for modern C++ is that you're on a Microsoft platform, or you're on GCC, or you're on Clang, there is no fourth vendor - you are screwed and nothing works. The era of $$$ proprietary compilers for weird targets on C++ ended and isn't coming back, C++ got too complicated for them and they gradually stopped implementing new features. But if you're on Clang you already have LLVM, which is a long way toward having Rust. If you're on a Microsoft platform that is the OS, I know, seems like they could do more but they didn't.
When you say "ridiculous architecture" if you got too far off piste you can't have modern C++ either. Even as you stray into the black zone stuff gets very fragile and I wouldn't risk it. Your CPU integer arithmetic isn't technically required to be two's complement for example, but good luck fixing all the weird things that break if it isn't.
- They often don't support any C/C++ compiler.
- If they support a fully custom one it's often not that grate. Potentially limited to C or even a subset of C (or a very small subset of C++)
- If they base it on gcc/llvm either they are not too obscure or you sooner or later run into compiler bugs. Also in that case it's not too much of a stretch to e.g. support Rust instead of C++ if you want to.
Although, this is for people who make modules, not for module users.
As long as modules are written and compiled, they're both faster and easier to use and re-use than headers+libraries, although I'm curious to see if this covers both multithreaded libs and not, debug/release symbols, 32 or 64 bits and so on. So far all those options means there are 8 versions for each lib.
I've heard that now, libraries built with a version of MSVC are compatible with future version of MSVC, which means I don't need to build libraries each time I use a new version of MSVC.