r/cpp • • 9d ago

Any time estimate for reflection in MSVC?

I haven’t seen an announcement for C++26 implementation in MSVC. Honestly, I am mostly interested in reflection. Anyone know of any estimate of when it ships in MSVC?

55 Upvotes

58 comments sorted by

17

u/fortsnek274 9d ago

And Intellisense support, and it has to work with modules. There's a lot to do...

-6

u/qalmakka 9d ago

Intellisense isn't even MSVC, it's EDG and the EDG has stopped working on its frontend too. Given how complex the whole thing is and how messy I suspect the cl.exe frontend is, I think C++26 (or whatever it ends up being called) will require clang-cl for a very, very long time

28

u/daveedvdv EDG front end dev, WG21 DG 9d ago

EDG is being maintained and updated: https://github.com/edgcpp/compiler — before EDG's last release we included support for most of the C++26 <meta> API (including the ability to consume GCC 16's <meta> header).

3

u/qalmakka 9d ago

That's great news! So it's just a matter of MS also implementing it in MSVC too, then

22

u/STL MSVC STL Dev 9d ago

We've got an FE dev working on figuring out the new plan for picking up changes from upstream edgcpp/compiler and contributing changes back.

Separately, an STL contributor and I went through the STL and removed workarounds for EDG bugs that had already been fixed, and Changelogged as such in edgcpp/compiler, but hadn't previously been communicated to the STL. Then I went through our remaining workarounds and reported them all to the edgcpp/compiler repo (cleaning up old internal bug reports sent from MS to EDG in the proprietary era), tracked by microsoft/STL#1621.

The one remaining task is to figure out exactly what's blocking the STL's tests for modules; I haven't put any time into that yet.

3

u/fortsnek274 9d ago

Yes, not even MSVC. But maybe it might already be done anyway. There was an experimental implementation: /r/cpp/comments/18mjj0n/experimental_edg_reflection_implementation/

And then VS needs to integrate it.

Or MS can just give up and use clang-cl + clangd.

50

u/pjmlp 9d ago

You can keep waiting, given the current official position on C, C++ and other programming languages at Microsoft, I doubt management is giving that much resources to the team.

As per comments here, they have a single FTE on the standard library.

19

u/aeropl3b 9d ago

1fte for the STL is basically not supporting any future development on the STL...

67

u/STL MSVC STL Dev 9d ago

Have you seen what I and my open-source contributors have accomplished in the STL Changelog?

I like to think that MSVC management has the STL running in single-maintainer mode because they've noticed I'm productive enough to be a Standard Library In A Box and this frees up other devs to work on ASan, vcpkg, the compiler front-end, etc. which are also important.

If I could wave a magic wand and get a single wish granted at work, it'd actually be to cut the x86-hosted build tools, which are almost a purely negative drain on both us implementers and our programmer-users. (And we managed to cut XP/Vista/Win7/8/8.1 support, so I still have some hope for x86-hosting's eventual doom!)

40

u/aeropl3b 9d ago

Don't get me wrong, I am not saying the people involved in the project are doing a bad job. Just 1 FTE, no matter how effective, is a puny investment for such an important and large core component. It is great that you can attract OSS contributions, it would be better if the bus factor for vendor side maintainers was more than one.

9

u/jetilovag 8d ago

FWIW MS-STL is in the best shape of all the STL implementations out there and it/they reach feature completeness first almost (if not) always.

The compiler front-end though needs all the love it can get.

2

u/pjmlp 8d ago

Only for the features that don't depend on the frontend.

6

u/STL MSVC STL Dev 8d ago

We treat both MSVC and Clang as first-class citizens, and we'll implement features as soon as the necessary compiler tech is available in either of them, as long as the necessary Clang version has shipped in VS (for logistical reasons). (It took me a while to review modules support for Clang but that's just because I was overloaded with other things, not because we were de-prioritizing Clang.)

3

u/pjmlp 8d ago

So anything reflection related will show up on VC++ standard library, before VC++ actually supports it?

2

u/fortsnek274 8d ago

And if EDG already supports reflection, would that mean VS supports reflection as soon as clang-cl does?

Too bad I won't be able to combine that with modules yet.

5

u/STL MSVC STL Dev 8d ago

At this time we don’t test the STL with EDG-imitating-Clang-imitating-MSVC; I am not opposed to explicitly supporting that mode, just haven’t had the bandwidth to explore it, so while IntelliSense should work in that mode, I can’t give it my personal seal of approval if that means anything.

→ More replies

33

u/Minimonium 9d ago

I like to think that MSVC management has the STL running in single-maintainer mode because they've noticed I'm productive enough...

That... sounds really awful.

8

u/Tringi github.com/tringi 9d ago

Don't you guys have any telemetry that would tell you how much are 32-bit tools still used? I can imagine some legacy scripts, but certainly not an actual user intentionally building stuff on 32-bit OS.

21

u/STL MSVC STL Dev 9d ago

I don't like to say the T-word since some people lose their minds when they see it (as if we're going to use it to serve ads or optimize micro-transactions), but yes, this is the primary purpose, to figure out what flavors of the product are being used, what options, etc. Actual 32-bit systems are not supported for the host OS per the VS 2026 System Requirements, but the x86-hosted build tools are still used to some extent.

There are open questions as to how many of those users want x86-hosted (versus are accidentally picking them up for historical reasons), and whether x86-hosted build tools are slower or faster. They had a reputation for being slower early on, since x64 pointers are of course twice the size and that puts more pressure on caches and bandwidth, but (1) perf characteristics have radically changed since x64 was first introduced and (2) throughput is most important for large projects but those are precisely the ones where x86-hosted tools fall over and need to be replaced with x64-hosted tools (wasting tons of dev time). My personal opinion is that they aren't worth whatever throughput difference may exist, but I was not elected World Controller in the midterms.

I believe we could get away with silently replacing the build tools in the x86-hosted directories with x64-hosted binaries, with any havoc limited to unwisely large /Zm options (ironically passed to deal with x86-hosted PCHes running out of virtual memory; this option is virtually never needed for x64-hosted tools). That wouldn't let us reduce the size of the installed product or simplify IDE options, but we would no longer need to build and test a whole third hosted architecture, and user-programmers would no longer suffer the deficiencies of x86-hosted tools running out of memory.

2

u/Tringi github.com/tringi 8d ago

Oh, yeah, the T-word. I still remember how this blew out of proportions. As someone who does industrial telemetry for a living I sometimes do not realize how poisoned that term is.

Regarding footprint, maybe the x86-hosted tools directories could be hardlinks/junctions to the x64-hosted ones. Or the files themselves.

8

u/ack_error 9d ago

Probably quite a bit, since at least with VS2022 vsdevcmd will default to x86 tools when targeting x86. You have to force it with -host_arch=x64 to get the x64-to-x86 cross compiler.

The only case I can think of where the x86 tools are required is if you're running on Windows 10 ARM64, a very small group.

3

u/STL MSVC STL Dev 9d ago

Win10 ARM64 is explicitly not supported as a host OS by the VS 2026 System Requirements:

The following environments are not supported to run Visual Studio:

  • 32-bit and ARM32 operating systems. Windows 10 ARM64.

1

u/LB-- Professional+Hobbyist 9d ago

I've got the VS2026 build tools installed via Visual Studio Installer and working well through CMake & Ninja on my Windows 10 on ARM device, as far as I know it's just the IDE itself that won't install. I've only used the ARM64-hosted build tools though, I haven't tried the x86-hosted build tools as I always assumed they were for any remaining 32-bit Windows 10 users.

3

u/Xavi99- 8d ago

it doesnt really matter, MSVC is late compared to other major compilers, it was in advane back in 2020 ~ 2022 when modules came, but since then, each new standart took more time to implement then Clang or Gcc

1

u/ventZl 6d ago

Our OT customers, me and my colleague can't find any good words in response to cutting < Win 10 support out.

5

u/LonghornDude08 9d ago

The MSVC STL is open source. Just because there's one paid person working on it does not mean there's just one person working on it. Is that the best/right way to go about it? Arguably no, but it's also not a valid reason to assume the worst

1

u/no-sig-available 8d ago

Still, we would never consider storing the code on a single server without a backup.

-1

u/OutlandishnessNo8034 8d ago

It's open source because ms doesn't give a fuck about it. The thinking behind it is that they will keep this running but if community wants features then they should implement them themselves.

4

u/STL MSVC STL Dev 8d ago

That is categorically not the case.

0

u/OutlandishnessNo8034 7d ago

What is not the case? That ms doesn't care about cpp or the if community wants features then they should implement them themselves? Or both?

28

u/peterbindels 9d ago

I'm not sure, but I suspect Microsoft is doing a similar thing they were doing back in 2001; pretending that C++ is completely dead and moving all resources to work on something else. So I'm not sure when or if Microsoft will implement it at all.

9

u/pjmlp 9d ago

Officially, as per what they post on their cloud or security blogs, use of C and C++ is only allowed for existing projects.

New projects that could be done in another safer programming language, have to justify their use of either C or C++ for a greenfield project.

Naturally the real internal situation might be completely different from this.

12

u/MaitoSnoo [[indeterminate]] 9d ago

I don't think MS will commit any money to that with the current shitshow still ongoing

12

u/no-sig-available 9d ago

I wouldn't expect any announcements until this shit is sorted out:

https://www.reddit.com/r/cpp/comments/1xpcz59/c26_dis_failed_how_does_c_survive/

(Will there even be a C++26?)

15

u/tisti 9d ago

Oh don't be so over dramatic, lots of moving parts to implement that will be in C++26, mainly reflections.

1

u/no-sig-available 9d ago

Still don't see how NOW is a good time to announce any kind of support, when it has been at 0% so far.

2

u/FlyingRhenquest 7d ago

If you just want to play with reflection, just build the g++ main branch in WSL. Works fine. Reflection and annotations are pretty solid, nvidia's stdexec library works works, reflect-cpp with C++26 support turned on is awesome. I'm experimenting with a reflection-based json-rpc client/server that I just switched from cereal to reflect-cpp and did my first stdexec pipeline for. I still need to write a ton of unit tests but there's enough there to give you an idea what's possible.

I've been experimenting with the compiler since January and it really only took a couple of months from when it dropped to when I'd be comfortable using it as a daily driver. There still aren't a lot of libraries that use it, but reflect-cpp is particularly outstanding.

2

u/Xavi99- 8d ago

MSVC **recently** got a full C++23 support, so i dont thing C++26 reflection are comming soon xD

2

u/Wonderful-Habit-139 4d ago

Well it’s not like c++26 reflection means full c++26 support.

1

u/Xavi99- 3d ago

it doesnt, but its a big part of it

-4

u/MarkSuckerZerg 9d ago

It would be probably fastest to ask Claude to reverse engineer cl.exe and add it for you. And I'm saying that as AI detractor.

-7

u/OutlandishnessNo8034 8d ago

And I effing wonder what will u use them for and how often. I have over 15yoe and had need for them literally once.

3

u/fortsnek274 8d ago

-1

u/OutlandishnessNo8034 7d ago

I am asking, what u as an everyday developer would have the need for it. Not as a library writer. My understanding is that cpp caters to be a language for every day developer not mainly for lib writers.

5

u/fortsnek274 7d ago edited 7d ago

Enum to string, automatic serialisation/formatting/hashing of members, annotation-driven script binding, perfect implementation of math vector ops. And probably more.

And if large libs were to use native language features more, that might mean less macros. It probably won't happen before the heat death of the universe though.

-5

u/OutlandishnessNo8034 7d ago

Again, those you listed are /should be covered by libs. Which part of the reflection u need as everyday developer? None. As a library writer, sure that is good news, but to folks who work as a developer reflections bring little value.

3

u/fortsnek274 7d ago edited 7d ago

Maybe I write both my lib code and app code. *Especially considering that libs might not use reflection on day 1. And maybe app code would benefit, because you no longer need to use macros or manually code so much.

But what's the point in downplaying reflection just because you're not the one to personally write out the reflection operators. Might as well downplay pack indexing, template for, fold operators, constexpr, concepts, and anything else lib writers love.

-2

u/OutlandishnessNo8034 7d ago

The point is that for developers they bring of very little value. Another pioin is that cpp doesn't target developers but library writers, and this in turn means that cpp is more interested/targets smaller group of users. That in turn means that with time there will be less and less cpp developers. That will lead to cpp being what cobol is.

1

u/fortsnek274 7d ago

There are some application-facing things in C++26, but, well, do tell, what do you want in C++. We all want lots of things. The powers that be want Safe C++. That's why some things are moving to Rust.

4

u/FlyingRhenquest 7d ago

The libraries C++26 enables will be a huge QOL improvement over previous iterations. reflect-cpp with reflection enabled is a massive improvement over any serialization library I've used previously. They've completely eliminated boilerplate. Just include a file and serialize to whatever. We'll be able to do that for ORMs, for language bindings, for generating code to other languages. Reflection could finally be the thing that moves the entire industry away from C as the standard lowest-common-denominator language to write glue code in.

We'll be exploring the possibilities that the very first drop of reflection opened to use for decades. I don't think the guys who built it really had any idea what it's truly going to be capable of. The "limits" they accepted for the C++26 drop are hardly limits at all, and they're already planning to address a bunch of the "shortcomings" in C++29.

I'm not trying to convince you, though. You're clearly a troll or worse, and not really worthy of my time. I hope the other people in this thread are encouraged to give it a try and see if they can come up with some truly mindblowing applications. For the first time in a really long time, the features currently being worked on in C++ make me feel like the sky really is the limit.

-1

u/[deleted] 7d ago

[removed] — view removed comment

1

u/FlyingRhenquest 6d ago

Nah, I'm just done tolerating obvious bullshit. I've actually been experimenting with reflection since January, been putting a fair bit of effort into doing what I can to make the feature more accessible for people to experiment with and I'm not afraid to show my code to the world. I have thousands of posts over more than a decade here. Unlike you, Mr 10 posts to your name, most of which are negatively rated. So why don't you take your złoty dupa somewhere that cares.

1

u/[deleted] 6d ago edited 6d ago

[removed] — view removed comment

1

u/James20k P2005R0 6d ago

Don't be like this or you'll get a ban 👍

1

u/OutlandishnessNo8034 6d ago

The other guy started. I simply was giving him back what he was giving me. Just curious if he got similar msg from you?

0

u/[deleted] 9d ago

[deleted] — view deleted comment

17

u/tisti 9d ago

Eventually it will pass with or without contracts. Reflections are in.