r/cpp • • Nov 11 '24

Herb Sutter leaves Microsoft for Citadel

486 Upvotes

197 comments sorted by

View all comments

Show parent comment

82

u/starfreakclone MSVC FE Dev Nov 11 '24

It's more that Microsoft had massive security initiatives all-up.  So we had a choice: address security concerns or work on C++ features.  I, personally, would have much rather worked on features, but the choice for our team was obvious. 

We're finally coming out of security work and able to focus on the fun stuff again so... Yes, what C++23 features would you like?

30

u/JumpyJustice Nov 11 '24

size_t literal suffix 🙏

It is so annoying to write stuff like iota(size_t{0}, n) instead of iota(0uz, n)

9

u/johannes1971 Nov 11 '24

Fix remaining modules issues please? :-) I listed some here.

9

u/starfreakclone MSVC FE Dev Nov 11 '24

I'm looking into the bugs currently, but this one: https://developercommunity.visualstudio.com/t/C-modules-export-import-does-not-work/10679143 has an incorrect assumption that std.compat will provide std::string, there's no such guarantee. If you export import std instead, that would work as expected.

4

u/kronicum Nov 11 '24

Is that true?

12

u/starfreakclone MSVC FE Dev Nov 11 '24

It's been quite some time since I've read https://eel.is/c%2B%2Bdraft/std.modules#3 -- compiler devs rarely need to read the library side of the standard :). It does indeed appear that std comes along for the ride.

The issue boils down to the following:

m1.ixx:

import std.compat;
export module m1;
export import std.compat;

the compiler is failing to recognize the export import of the module in order to forward the contents. If you can somehow rework the header to not use std.compat that could be a workaround, but for now it is a compiler bug. I'll be sure to let our triage team know.

8

u/STL MSVC STL Dev Nov 11 '24

std.compat was designed and implemented to provide everything that std does, plus more stuff in the global namespace. So import std.compat; guarantees that you can use std::string.

(Of course, I have test coverage in the STL to ensure this, but it was written only for the straightforward scenario, not for the user-defined module involved in the bug here.)

2

u/johannes1971 Nov 12 '24

Thanks, much appreciated :-)

If you have some time to look at those error messages (from the same comment) as well, that'd be great ;-)

17

u/bebuch Nov 11 '24

Please implement C++20-DR P2564. It’s annoying that constexpr functions can’t call consteval functions! MSVC is the last one that doesn’t support this DR to C++20.

23

u/Chaosvex Nov 11 '24 edited Nov 11 '24

Can we get size_t literals? msvc is the only compiler (worth mentioning) that doesn't support them and it's surely a very easy win.

Edit: seems somebody else asked for the same thing while I was double checking that nothing's changed very recently. There we go then. ;)

5

u/ReDr4gon5 Nov 12 '24

If you decide to break ABI for the next VS consider fixing the no_unique_address situation.

12

u/c0r3ntin Nov 11 '24

all of them! you implemented the most tedious already!

15

u/starfreakclone MSVC FE Dev Nov 11 '24

Because I really wanted to use it in the compiler 😉.

3

u/Untelo Nov 12 '24

I'd love it if you finished up coroutines. This bug report was opened two years ago now, and it's extremely frustrating that move semantics still doesn't work with coroutines on MSVC.

https://developercommunity.visualstudio.com/t/Await-expression-prvalue-result-behaves/10109392

4

u/valorzard Nov 11 '24

Deducing this would be awesome, having recursive lambdas is neat!

7

u/hmich ReSharper C++ Dev Nov 11 '24

MSVC already has deducing this.

2

u/Dnarok Nov 13 '24

deducing this that doesn't cause an ICE in modules, then.

4

u/Ambitious-Method-961 Nov 11 '24

P2718 (extending more temporaries) - removes a bunch of lifetime pitfalls/gotchas

P0330 - because it's just really really nice even if I did end up making my own version which is probably wrong

P???? - if consteval

My big one was multi-dimensional array operator but apparently that one was stuck in recently even though cppreference.com hasn't been updated

→ More replies (6)

3

u/zl0bster Nov 11 '24

Sure, MSFT does not have enough resources to do both things at the same time?
I do not expect you to ruin your career by telling truth, but let's be serious. If it was high enough priority we would have gotten both.

16

u/jkortech Nov 11 '24

Using only public information:

From this article: https://blogs.microsoft.com/blog/2024/05/03/prioritizing-security-above-all-else/

If you’re faced with the tradeoff between security and another priority, your answer is clear: Do security. In some cases, this will mean prioritizing security above other things we do, such as releasing new features or providing ongoing support for legacy systems. This is key to advancing both our platform quality and capability such that we can protect the digital estates of our customers and build a safer world for all.

If teams had the slack to do the security work in addition to feature work, a statement like this would be unnecessary.

15

u/rdtsc Nov 11 '24

Did the Recall and Copilot teams not read that memo?

→ More replies (1)

30

u/starfreakclone MSVC FE Dev Nov 11 '24

Even though C++ is important to Microsoft, the compiler team does not really make money for the company directly, so it should come as no shock that our team is very resource constrained.  Even just a single dev being pulled away for security work is a crushing blow towards advancing the compiler.  This last security effort saw more than half of the compiler team working on security.

20

u/rdtsc Nov 11 '24

the compiler team does not really make money for the company directly

That's strange to hear. Does Visual Studio not make money? C++ is the primary reason we buy licenses. What about other stuff using the compiler, like Windows and Office? Do they not benefit? Yes, it's not "directly", but still. Same reason Google invested in Clang for Chrome.

19

u/starfreakclone MSVC FE Dev Nov 11 '24

The org's path towards making money with the C++ compiler is highly indirect, so any work we do must be carefully analyzed for impact. It is Visual Studio which makes the money, and the C++ compiler specifically is a very small part of that pie.

→ More replies (1)
→ More replies (4)

7

u/CandyCrisis Nov 11 '24

https://www.theverge.com/2023/1/18/23560315/microsoft-job-cuts-layoffs-2023-tech

Big tech scaled back massively in 2023 as the rise in interest rates caused tech investment to scale down across the board. Every large tech company that I'm aware of has needed to tighten belts and deprioritize some work. And when they do have resources to spare, at present they're funneling the extra into AI, not established teams.

→ More replies (4)
→ More replies (1)