Re: [dev] Optimizing C compiler & c++ compiler/runtime

From: Sylvain BERTRAND <sylware_AT_legeek.net>
Date: Fri, 20 Dec 2013 17:31:26 +0100

On Fri, Dec 20, 2013 at 04:35:36PM +0100, Paul Onyschuk wrote:
> On Fri, 20 Dec 2013 13:49:43 +0100
> Sylvain BERTRAND <sylware_AT_legeek.net> wrote:
>
> > Is there any remaining good c++ compiler/runtime which can
> > boostrap using a C compiler/minimal runtime?
> >
> > Since, it's near impossible to re-write/unroll all the
> > "mandatory" c++ components in C quickly (harfbuzz,
> > gecko/webkit...), what to do? Any suggestions?
>
> Not that I'm aware of, beside I'm not sure what benefits this would
> bring? You're fine with C++ in one place, but not the other?

Actually, the only c++ components which bother me are "modern"
javascript-enabled www renderers and harfbuzz (but I coded a C
_partial_ port).
netsurf is far from being usable on www sites where javascript is
mandatory.

> > There is also the question of finding a new C99 optimizing
> > compiler written properly in C of course.
> >
> > Anything else?
>
> This is valid question on other hand e.g. base OpenBSD is C++ free for
> some time AFAIK (after the removal of groff). Idea of minimal set of
> tools, capable of rebuilding itself is attractive.

Oh! What openbsd uses for its man page terminal renderer? I'm
stuck with the buggy heirloom tools.

> On one hand, you can use pretty old GCC and most of C codebase will
> compile just fine (OpenBSD still uses patched GCC v4.2.1, which is more
> than six years old). C is stable - you will more likely see changes in
> standard C library, than compiler/language itself. GCC v4.7.x should
> work just fine for some years to come.

ARM64 is on its way, which will require a backport in gcc 4.7.x.

> C++ is different kind of beast. More and more software requires C++11
> features and this means very recent version of compilers, especially
> since C++ standard libraries are developed inside the same projects
> (GCC/libstdc++, Clang/libc++). Sticking to GCC v4.7.x isn't an option
> here as far I can tell.

Yes... c++ is a fast moving target. Since its implementation cost
is just insane, coding from scratch a C implementation seems
unreasonnable. We will have to chain compile gccs to reach a
c++11 compiler and runtime. Basically, this is laughing right at
the face of the entire planet.

> The last problem: C99-capable compiler isn't enough to get usable
> system based on Linux. Clang which was designed as GCC drop-in
> replacement chokes on Linux kernel (some patches are needed), because
> it heavily uses GCC extensions and specific features (some
> undocumented/undefined).

That's very bad. Linux kernel devs have not accepted patches to
allow compilation with alternative C compilers??
Received on Fri Dec 20 2013 - 17:31:26 CET

This archive was generated by hypermail 2.3.0 : Fri Dec 20 2013 - 17:36:16 CET