Top
Best
New

Posted by iandinwoodie 3 hours ago

EDG C++ front-end goes public(edgcpp.org)
94 points | 33 commentspage 2
stuaxo 2 hours ago||
"Three tracks, one codebase" this is such an LLM written sentence.

EDIT: But in this case it seems something significant is being released, it would be better with less writing and more human if possible.

my-next-account 3 hours ago||
What is this?
dgrunwald 3 hours ago||
It's one of the 4 big remaining C++ compiler frontends: gcc, clang, MSVC, EDG. Most other C++ compilers are based on either EDG or clang. (e.g. the Intel C++ compiler used to be based on the EDG frontend, though modern versions are based on clang instead)

The "frontend" is the part of the compiler that understands the input language: lexer, parser, template instantiation, constexpr evaluation, ... The EDG frontend produces an intermediate representation (IL) that is then used by the different compiler vendors to generate machine code. Or do code analysis.

EDG can also be used as a C++-to-C compiler.

ur-whale 2 hours ago||
> EDG can also be used as a C++-to-C compiler.

Nice to see this still exists!

After all, this is how it all started back in the days of - what was it called again ? - yeah, cfront

https://en.wikipedia.org/wiki/Cfront

OneDeuxTriSeiGo 3 hours ago||
https://en.wikipedia.org/wiki/Edison_Design_Group

TLDR EDG C++ is a compiler frontend developed by EDG since the 80s which has been used under the hood for a whole bunch of commercial C and C++ compilers, static analyzers, linters, and IDE code completion tools.

Odds are if you are familiar with a closed source tool in one of those categories above, there's a decent chance it uses EDG's frontend somewhere in it under the hood.

cyberax 2 hours ago||
It has an interesting code style, the comments go _after_ the function definition but before the opening bracket.

It looks weird, but it actually makes sense! The flow is more natural - first the function definition, and then the explanation of what it does. It also avoids repeating the function name.

compiler-guy 27 minutes ago||
Code from that era predates the web, and a lot of open source style guides, and even most open source code itself.

So it came up in an era where folks were inventing their own style and the huge homogenizing influence of the gnu standards (and other open source projects) hadn't taken hold.

I like it. It feels like another language, and has its advantages. I really like to know of alternate ways of doing things, even if I don't adopt them myself.

spatulon 1 hour ago|||
One of the more unusual aspects is the naming convention for types. Most type names use the a_ prefix (e.g. a_statement_ptr), but names beginning with a vowel start with an_ instead (e.g. an_object_lifetime_ptr).
1718627440 2 hours ago|||
I write comments about what a function does and it's interface before, but comments about the implementation after. Also my pre- and post-conditions go there of course. (I'm mostly writing in C.)
mhh__ 2 hours ago|||
This is also where conditions go in languages with contracts, I like it
zerr 2 hours ago|||
This is common in Lisps.
bobmarleybiceps 2 hours ago||
never occurred to me to write a comment there, but it actually looks kind of clean imho. Really old C code looked like

void func(var1, var2) int var1, char* var2. { ... }

perhaps some legacy from that? Probably not, but just first thing that popped into my head since it feels similar :shrug:

ritualdevin 1 hour ago|
[dead]