Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think Microsoft should give up msvc and move to clang instead or compete with GCC/clang on all platforms #770

Closed
trcrsired opened this issue Jul 5, 2024 · 1 comment

Comments

@trcrsired
Copy link
Member

trcrsired commented Jul 5, 2024

I urge Microsoft to give up Microsoft Visual C++ (MSVC) and move to LLVM Clang for the following reasons:

  1. 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.
  2. Lack of Progress: According to cppreference, Compiler Support shows that MSVC has zero C++ 26 support, and even C++23 lacks progress.
  3. 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_builtin and vector extension are 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

  1. 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.

  2. 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.

  3. 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.

  4. 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

  5. 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.

  6. 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.

  7. ABI Compatibility: Maintaining MSVC STL for ABI compatibility should continue, ensuring a seamless transition.

  8. 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.

  9. 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.

@trcrsired trcrsired changed the title I think Microsoft should give up msvc and move to clang instead I think Microsoft should give up msvc and move to clang instead or compete with GCC/clang on all platforms Jul 7, 2024
@trcrsired
Copy link
Member Author

trcrsired commented Jul 7, 2024

If microsoft does not want to give up msvc, i suggest microsoft to make msvc open source and compete with clang at least for supporting linux etc. supporting target and sysroot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant