Remix.run Logo
▲ dgrunwald 2 hours ago

Despite using C++ for a few years now, the EDG source code is still mostly C code (and in fact, the C++ code is still using the old .c file names). In particular, there's no usage of the C++ standard library.

Where other languages might use inheritance, EDG still uses the C-style `union { ... } variant;`.

On a related note, compiling EDG is extremely fast: on my machine, the EDG frontend compiles in <10s; whereas clang takes >10min (caution unfair comparison: clang includes much more than just a frontend).

▲smlacy 2 hours ago | parent | next [-]

I think this is fairly common practice when writing compilers. You ideally want to be able to bootstrap from other languages, and C is a much simpler starting point.

▲waynecochran 2 hours ago | parent | prev [-]

Yes, of course. It makes complete sense to have the implementation of a C++ compiler to be written in a highly portable and much simpler language like C.