Hi César
Welcome to TinyCC

> Basically, what I need is just a C compiler.
> Written in C. A good C compiler.

It depends, what you define as a 'good' compiler.

TinyCC is a single pass compiler and very good at compilation speed.
The code created by TinyCC is often remarkable slower,
compared to code created by gcc/clang.


> With a not too complex code tree and
> reasonably easy to port to new targets in the future. That's it.

Yes, the simple codebase is one of the goals of tcc.

> It seems the old "portable C compiler" is either gone or abandoned
> (the website is down).

pcc is still under development, but the pcc webpages are often down.
https://pcc.ludd.ltu.se

pcc has more / different targets and even
basic frontends for Fortran77 and c++,
but development is very slow, done by one person.

> TinyCC looks very appealing to me, but, before I embark on it,
> are there any important warnings I should be aware of?

* TinyCC has only very few optimizations
(only constant folding and in some situations code supression)
* TinyCC compiles expressions self contained.
That's simple and fast to compile,
but a lot of code for loading of args & saving of results is created.
Many other compiler produce far better code for such situations.

> Does anybody use it on MacOS on a daily basis? With Apple Silicon?

Sorry, i have no idea.

> Does hardware floating point work fine in float and double precision
> on Intel x86, x86_64, and on Apple Silicon?

Should work and should produce correct results
(i made my tests on linux x86_64 / x86)
but see above (self contained expressions: very likely slower code)

> Also: are there plans to support OpenMP,

No. The TinyCC codebase should stay as simple as possible.
Creating a parallel version of a loop requires a deep analyse of the code,
which is too complex for TinyCC.

> The thing is that all recent CPUs are multicore,
> and you are sort of wasting them if you don't parallelize costly loops...

TinyCC does not fully support all C11 features yet.

I use the "C11threads" package in some of my code (on top of pthread)
(other packages with similar code is available online),
but when using threads,
you have to think about parallel execution in all of your code.



TinyCC is so much faster than other compiler, that TinyCC is used
as a backend for a different language (vlang),
when the v code is trans-compiled to C.
(tcc is used, when vlang compiles in DEBUG mode,
and clang is used otherwise).

(from the vlang repository: tcc: 500k loc/s, clang: 100k/s)

my test on my machine for v.c (6418031 byte)
tcc: 0.233s (680k lin/s)
gcc -O0: 7.999s
clang -O0: 3.779s

--
Regards ... Detlef


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

Reply via email to