‹ BackHN Continuity

Thread

EDG C++ front-end goes public

249 points · 129 comments · iandinwoodie

  1. dgrunwald · · focus · HN ↗
    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).

    1. smlacy · · focus · HN ↗
      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.
    2. waynecochran · · focus · HN ↗
      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.
    3. criemen · · focus · HN ↗
      They also have a distinct style/naming convention, see for example `a_list_entry` as type name.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.