-
Notifications
You must be signed in to change notification settings - Fork 69
Description
I urge Microsoft to give up Microsoft Visual C++ (MSVC) and move to LLVM Clang for the following reasons:
- Industry Standard: Clang has become the defacto industrial standard. Major corporations, including every other "magnificent seven," have adopted Clang. Even Intel has abandoned its ICC for Clang. Given the complexity of the C++ standard, it's no longer worth the resources to maintain a proprietary C++ compiler front end.
- Lack of Progress: According to cppreference, Compiler Support shows that MSVC has zero C++ 26 support, and even C++23 lacks progress.
- User Preferences: C++ library developers often express dissatisfaction with MSVC. Compared to GCC and Clang, it lacks optimization, and many useful features such as
__has_builtinandvector extensionare absent. This is partly because many optimizations are architecture-specific, and Microsoft has limited control over architecture design.
These are examples of why supporting MSVC is a huge pain:
https://github.com/cppfastio/fast_io/blob/master/include/fast_io_core_impl/intrinsics/msvc/x86.h
https://github.com/cppfastio/fast_io/blob/master/include/fast_io_core_impl/simd/generic_operations.h
https://github.com/cppfastio/fast_io/blob/master/include/fast_io_hosted/platforms/win32/msvc_linker_64.h
-
Geopolitical Considerations: Increasing geopolitical tensions between the US vs Russian+Chinese highlight the need for independence from ARM licensing. MSVC does not support architectures like RISC-V and LoongArch, preventing Windows from expanding to these platforms. Transitioning to Clang would facilitate support for these architectures, ensuring Microsoft remains competitive.
-
Security: Much of today's security research leverages LLVM, leading to LLVM-exclusive security mitigations. For instance, ARM Memory Tagging Extension (MTE), crucial for enhancing memory safety on Windows, remains unsupported due to MSVC. Moving to Clang would address this gap.
-
AI and CUDA Support: As Microsoft pivots towards AI under Satya Nadella's leadership, aligning with LLVM would enhance support for technologies like Nvidia CUDA. This strategic move aligns with the company's AI focus.
-
Bug Fixes and Cross-Compilation: MSVC poses challenges for fixing certain bugs, especially on ARM. Game developers struggle with debugging on ARM, and cross-compilation is simpler with GCC and Clang. Abandoning MSVC would ease these processes and enable cross-compiling Windows binaries on Linux, benefiting developers. [clang] Support --sysroot= for ${arch}-windows-msvc targets llvm/llvm-project#96417
-
Outdated Extensions: MSVC extensions like CLR have been deprecated, and MSVC lacks full C++20 support. Moving to Clang does not face any extension support issues, making the transition smoother.
-
Revenue Impact: While MSVC is free, Visual Studio is not. Moving to Clang would not affect Microsoft's revenue but would enhance Visual Studio's utility for cross-platform debugging, particularly for Android, thanks to LLVM.
-
ABI Compatibility: Maintaining MSVC STL for ABI compatibility should continue, ensuring a seamless transition.
-
Proven Success: Microsoft successfully transitioned Edge from EdgeHTML to Chromium, significantly boosting its market share. According to statcounter, on desktop, Microsoft Edge's market share increased from 3% to 14% for this transition and surpassed firefox and even safari for browser marketshare; on mobile, it increased from 0% to 0.3%, which is very small, showing that Microsoft needs to return the phone OS market to Windows 12. Similarly, integrating Rust into DLLs has made Windows reliant on LLVM. Transitioning from MSVC to Clang would mirror this successful strategy, strengthening Microsoft's position.
-
It won't harness competition. Some people complain that this would give Google too much control, which is funny. LLVM is not Google's Project. Also, you should not expect Microsoft to break the power you think there is, either. Microsoft is a capitalist corporation whose only goal is to boost shareholder value. It is never about "preventing Google from controlling the internet" or something. Also, Microsoft giving up EdgeHtml has encouraged more innovation for the new Ladybird project. The new C++ compiler will happen again in the future if LLVM stagnates. With time, people will try again, and a fresh open-source codebase would be much better than the existing ones, GCC and llvm.
In summary, giving up on MSVC and moving to Clang would streamline development, enhance security, and align Microsoft with industry standards, ensuring continued innovation and competitiveness.