tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] RE :Re: modern c++ compiler written in C (food forthought


From: Christian JULLIEN
Subject: [Tinycc-devel] RE :Re: modern c++ compiler written in C (food forthought)
Date: Tue, 3 Nov 2015 09:16:01 +0100 (CET)

Hum, sorry I still don't understand quite well your exact motivation with Cfront.

motivation-1) POC to make Cfront usable with TCC toolchain.
- A funny toy project. Change Cfront so that it compiles with TCC *and possibliy* change CFront C code generator so that unmodified TCC can compile and run Cfront valid programs (nowhere here I use C++ term or I speak about speed)

motivation-2) produce the world fastest CFront compiler ever.
 - change Cfront so that it compiles with gcc -O3  *and possibliy* change CFront C code generator so that unmodified TCC can compile and run Cfront valid programs (nowhere here I use C++ term). For sure, this is the fastest way to produce Cfront programs that execute something.

motivation-3) have an object oriented C extension on top of TCC
- Cfront is an object oriented C extension which allows a kind of OOP programming (sometimes very close to ISO C++). Btw why do you need this as, due to license limitation, you will not be able to ship anything unless you limit yourself to the common subset of both 'modern c++' and Cfront, even stream ios are different.

motivation-4) have a modern c++ compiler written in C.
- Cfront is definitely not a modern c++, it will take age to make it c++ compliant, even with C++98

other motivation?

Christian
----- message d'origine -----
De : "Jared Maddox" <address@hidden>
date mar. 03/11/2015 00:03 (GMT +01:00)
À : "address@hidden" <address@hidden>
Objet : Re: [Tinycc-devel] modern c++ compiler written in C (food forthought)

> Date: Sun, 1 Nov 2015 07:30:14 +0100
> From: "Christian Jullien" <address@hidden>
> To: <address@hidden>
> Subject: Re: [Tinycc-devel] modern c++ compiler written in C (food for
> thought)
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
>> : in fact, Comeau C/C++ compiles to C, and until recently was the ONLY
> major compiler to support some C++ features.
>
> Sure, C backend as interim code generator works well provided you rely on C
> optimizer to polish the code. I do the same with my OpenLisp compiler (see
> how it works here https://en.wikipedia.org/wiki/OpenLisp#Compiler).
> The idea is to first optimize as much as you can and then target a so simple
> C code that it's a piece of cake for C optimizer to finish the job.
> My compiler beats native "Lisp->bare metal assembler" compilers because it
> uses all tricks -O3 is able to do. It achieves good performances at the
> price of a very long optimization analysis (sometimes, a single lisp file
> generates half megabyte non commented C file!!).
>
> NOW
>
> What is "funny" with tinycc is that, due to the lack of optimization,
> compiled code is twice as SLOW as interpreted code and remember that my lisp
> compiler already does branch tension, dead code elimination, constant
> folding, redundant store elimination and few other optimization before C
> code generation.
>
> I bet it would be even worse with the code Cfront generates.
>

If you read my previous email, you'll see that at no point did I say
that low speed of resulting programs should be considered a reason for
this project to stop. This is because low speed of resulting programs
should not be considered a reason for this project to stop. TCC has
never been about producing fast programs, but instead has always been
about producing those programs quickly. The only relevant question is
whether it can compile programs quicker than the common C++ compilers,
everything else is a distraction.

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]