I’m curious why odin needs MSVC compiler and windows SDK while other languages (like go, zig etc) doesn’t need any addional packages. It’s annoying to install and somewhat heavy depency.
Also is there any plans to remove this depency in the future?
When doing Windows development in general, you effectively require the MSVC toolchain to do anything useful. It’s annoying but it’s not really something you can remove because so much relies on it—especially third party libraries.
The MinGW toolchain is not a replacement/alternative for the MSVC toolchain for loads of reasons. The C API is meant to be ABI compatible but I’ve had loads of issues where it isn’t (usually some library relied on something they shouldn’t). And C++ API is 100% not ABI compatible at all.
Many languages like Go have their own closed off ecosystem which means they don’t require a separate toolchain. And when Go deals with foreign code through CGo, it’s effectively a completely separately system and an absolute pain to work with.
We could/should try to minimize this issues in the future, but it’s sadly one of those facts of developing for Windows. You have to use the ecosystem Microsoft provides, and it isn’t small.
There is this PortableBuildTools (https://github.com/Data-Oriented-House/PortableBuildTools) thing which allows you to download the MSVC compiler, linker, and general toolchain into a portable directory without needing to install Visual Studio. I have personally not used it, but this does show you that you can at least deal with this in a lot simpler way.
Is there more information about this topic? I am interested to understand it better, which parts of msvc toolchain are used, i can understand that the linker is used to link to the vendor libraries, but not sure why the compiler would be used? How does zig compare to the msvc requirement, do they also need it?
Take a look at build.bat there you can see the tools used.
For easier installation maybe give winget a go Installing VS C++ workloads with winget · GitHub then you can at least script it.
Heh who knows maybe Odin could be installed via winget one day just can’t see it work that well, compare to just build Odin yourself
https://learn.microsoft.com/en-us/windows/package-manager/package/