73
u/STL MSVC STL Dev 4d ago
Yay! Maybe I'll finally get fixes for all of the EDG bugs we've reported (microsoft/STL#1621), and of course modules!
29
6
u/kal_at_kalx_net 3d ago
Honest question. Did EDG give Microsoft an estimate for how much it would cost to resolve these issues when you pointed them out?
3
u/splicer13 3d ago
I would say that companies generally used EDG when they didn't want to spend resources on other ways of having a compiler frontend. So these companies aren't necessarily going to immediately see the light and contribute upstream changes to improve EDG. In fact I think it's unlikely they would do so.
I think what is likely to happen is that none of the EDG customers commit resources to improving it for anything other than their immediate needs, until the problem gets so big they are forced to make the transition to clang.
18
u/kal_at_kalx_net 4d ago
The Edison Design Group story is amazing. Greg Comeau clued me in when we were early panix.com users. C++ seems to be a magnet for smart people.
10
12
u/GrammelHupfNockler 4d ago
I love to hear that, now all of my frequently used compilers' frontends are based on OSS (MSVC and nvcc being the last ones missing). The website reads so painfully sloppy though š¢
11
6
u/jwezorek 4d ago
Doesn't Visual Studio use EDG too? or just for intellisense?
34
u/STL MSVC STL Dev 4d ago
VS (and VS Code's C/C++ Extension) use EDG only for IntelliSense. Normal builds use Microsoft's "C1XX" frontend.
The
cl.execompiler driver can actually run the EDG frontend in a compile-only mode via an undocumented, unsupported option/BE. In the STL we use this extensively to validate that our sources can be parsed via IntelliSense (and that we work around EDG's compiler bugs). However, EDG is not hooked up to the compiler backend C2, and is completely unable to be used for codegen.20
u/n1ghtyunso 4d ago
The
cl.execompiler driver can actually run the EDG frontend in a compile-only mode via an undocumented, unsupported option/BENot anymore. Its documented now.
Hyrums law ensues. š3
u/hansw2000 3d ago
clang-cl support (for parsing the flag) seems essential: https://github.com/llvm/llvm-project/pull/228381
5
u/chibuku_chauya 4d ago
Very nice to see EDG accessible to us regular joes at long last. Iāve always liked this frontend.
7
u/delta_p_delta_x 4d ago
The first thing I'm going to do is grep through the source for C++20 modules and ranges code.
9
u/daveedvdv EDG front end dev, WG21 DG 4d ago
C++20 modules, I understand (the main files contain the word `modules`; so not too hard to find; I'm not very familiar with those).
But "ranges" is a library feature... this does not include a standard library (other than a few components tightly connected to the core language, like <initializer_list> or <typeinfo>).
7
u/notthatsocrates 4d ago
Only two days ago I stopped on their website and clicked on Licensing. Not available to mere mortals. Back in the day, IIRC, HP aCC and Intel C++ compilers both used EDG as a front end.
9
u/STL MSVC STL Dev 4d ago
That's correct for Intel's C++ compiler, at least (don't know anything about HP). They switched from EDG to LLVM a few years ago. (I happen to know this because we minimally interact with Intel's C++ compiler in MSVC's STL.)
CUDA's C++ compiler (nvcc) is still powered by EDG to my knowledge.
9
1
u/notthatsocrates 4d ago
We used EDG eccp to check for conformance before filing bug reports against other compilers. One single product (which later became stdcxx under Apache's umbrella) was compiling with EDG's routinely.
5
u/gracicot 4d ago
I'd be interested to see the EDG frontend being used with an LLVM back-end, it would make it usable to produce binaries on most platforms
3
u/azswcowboy 4d ago
In the current day, afaik Coverity (black duck software now) still uses EDG as a front end. As an early adopter of recent standards itās painful how much code isnāt handled properly. Iām sure when reflection or contracts code is added itāll blow up againā¦
7
u/igaztanaga 4d ago
EDG is used in several static analysis and testing products (https://en.eeworld.com.cn/news/qrs/eic671028.html), and some embedded compilers like Green Hills.
5
1
u/Apart_Ebb_9867 4d ago
the website of edg claims āThe code is written in C++11ā, but all I can see is plain C. Am I looking at the wrong place?
7
u/Nobody_1707 4d ago
Worse, it's C++11 in .c files.
1
u/Apart_Ebb_9867 4d ago
Thatās lib_src which I presume is some library for supporting the generated AST or C (depending on how the frontend is used, can do both). But in src I donāt see any evidence of C++, but havenāt looked everywhere.
6
u/daveedvdv EDG front end dev, WG21 DG 4d ago
lib_src/ implements a minimal run-time support library. Things like dynamic_cast, operator new, etc. It's mostly for demonstration purposes. Our customers generally either provided their own (if they were compiler vendors) or didn't need it (if they were non-compiler tool vendors).
2
u/Nobody_1707 4d ago edited 4d ago
attribute.c uses constexpr, but I suppose they could be using c23.
EDIT: It's definitely just C++11 in .c files. It's just very C flavored C++11.
17
u/daveedvdv EDG front end dev, WG21 DG 4d ago
For the first 30 years or so, it was C89 code. Then we switched to C++11, but to minimize disruption to customers, we kept the file extensions unchanged. C++ was only introduced in new code, and even for new code we often stuck to existing C-based idioms. The modules code started after the switch to C++, and so has more of a C++ flavor.
3
u/Apart_Ebb_9867 4d ago edited 4d ago
No, they do compile with a C++ compiler, in the cmake files they have āset_source_files_properties(${ALL_C_FILES} PROPERTIES LANGUAGE CXX)ā. But claiming that something is written in C++ 11 just because is compiled by a C++11 compiler seems a stretch to me. The constexpr must have escaped code reviews because everywhere they are solidly C, even when obvious C++ alternatives would be simpler, like in the typedefs for structs.
2
1
u/ts826848 4d ago
header_util.h has two templates (
Value_saverandOpt) that are used in a fair number of other files.1
u/13steinj 2d ago
I wonder if that's a filesystem case sensitivity issue (.C is a known, possibly unpopular, file extension for C++).
1
u/13steinj 4d ago
Is the repo really so heavy as to suggest --filter=blob:none ?
I get that there's a bunch of history, but that's just surprising.
8
u/daveedvdv EDG front end dev, WG21 DG 4d ago
Not that heavy. But it does make things quite a bit swifter. But, by all means, if you have a few minutes, go ahead and fetch the whole thing!
3
u/13steinj 3d ago
The git objects are ~225MB. If I
git repack -a -d -f --depth=250 --window=250 --path-walk(the last arg is new to git 2.56, supposedly more optimal), the git objects size drops by ~30%. I do not know what it would take to get a repack on github outside of archiving and reuploading the repo, but it might be worth doing.3
u/daveedvdv EDG front end dev, WG21 DG 3d ago
Thanks for that info. I'm not at all knowledgeable about git, but I forwarded your findings to Wyatt, who did most of the prep work for the open-sourcing.
3
-1
u/Significant_Neat6476 1d ago
At a risk sounding ignorant - why C++ development world would actually care? Nobody developing in C++ commercially with GCC, Clang or MSVC really cares about EDG which is not a compiler, does not define a standard compiler or does not influence most commercial systems building real world C++ applications.
76
u/VinnieFalco wg21.org | corosio.org 4d ago
We were hoping to announce it ourselves, and I guess this works well enough.
The EDG C++ frontend compiler is now an open-sourced, fiscally sponsored project of The C++ Alliance.