sinemakinci1 / Cpp-Copilot-VSC-Demo

0 stars 0 forks source link

Hi. Sinem Akinci. I think Microsoft should give up msvc and move to clang instead #8

Closed trcrsired closed 2 months ago

trcrsired commented 2 months ago

As a small shareholder of Microsoft, I urge the company 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 Microsoft and 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, China, and Russia 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 in the future.

  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. https://github.com/llvm/llvm-project/pull/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 market share. 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.

In summary, giving up from MSVC and moving to Clang would streamline development, enhance security, and align Microsoft with industry standards, ensuring continued innovation and competitiveness.

trcrsired commented 2 months ago

Or open source it to make MSVC a cross platform compiler. Being like clang for --target --sysroot support.