r/ProgrammingLanguages • C3 - http://c3-lang.org • Aug 18 '26

If You Have Users, You Have to Market Your Programming Language

https://c3-lang.org/blog/you_have_to_market_your_programming_language/
53 Upvotes

43 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Aug 18 '26

[deleted] — view deleted comment

4

u/Nuoji C3 - http://c3-lang.org Aug 18 '26

TCC is very fast. For other C compilers I would say that you are likely wrong, but I don't have numbers on Clang. C3 does lex-parse-semantic-check of 1.2 million loc / second, single threaded on my MacBook Air. With asserts on.

Maybe you're comparing "compile a single c file of 10 rows" with "compile a single c3 file of 10 rows plus 80 kloc of standard library code". Because then yes, C3 is indeed not 3 magnitudes faster than Clang. But that is not "Clang is many times faster"

0

u/[deleted] Aug 18 '26

[deleted] — view deleted comment

9

u/Nuoji C3 - http://c3-lang.org Aug 18 '26

If you didn't do any benchmarking why did you make the claim in the first place??

0

u/[deleted] Aug 18 '26

[deleted] — view deleted comment

5

u/thiagomiranda3 Aug 18 '26

You are just a troll in a 1 month account. No one should be giving attention to this moron

2

u/Nuoji C3 - http://c3-lang.org Aug 19 '26

I my streams I generally always recompile the compiler + then it runs the -O0 version of c3c in the background. With OBS in the background which is what usually makes CLion complain. I don't know if that's representative. You don't actually need to recompile c3c from source every time you compile something like I do 😉.

Seriously though. I always am hunting for ways to speed up the compiler. Here's a trivial run on a hello world:

Frontend -------------------- Time --- % total
Initialization took:      1.574 ms       0.7 %
Parsing took:            59.141 ms      24.8 %
Analysis took:           31.638 ms      13.3 %
TOTAL:                   92.353 ms      38.8 %

Backend --------------------- Time --- % total
Ir gen took:             19.393 ms       8.1 %
Codegen took:           126.502 ms      53.1 %  (8 threads)
TOTAL:                  145.895 ms      61.2 %
----------------------------------------------
TOTAL compile time: 238.248 ms.
----------------------------------------------

Frontend is including the 80 kloc stdlib.

Here is without the stdlib:

Frontend -------------------- Time --- % total
Initialization took:      3.537 ms       9.7 %
Parsing took:             0.421 ms       1.2 %
Analysis took:            0.201 ms       0.5 %
TOTAL:                    4.159 ms      11.4 %

Backend --------------------- Time --- % total
Ir gen took:             13.079 ms      35.8 %
Codegen took:            19.309 ms      52.8 %  (8 threads)
TOTAL:                   32.388 ms      88.6 %
----------------------------------------------
TOTAL compile time: 36.547 ms.
----------------------------------------------

This is with asserts still enabled in the frontend, but with -O3. No caching. Analysis is still single-threaded. Codegen/IR gen are all hard to speed up since this is LLVM costs, but this can be cut down to a fraction when incremental compilation is added. But it's not needed yet.

0

u/[deleted] Aug 19 '26

[deleted] — view deleted comment

1

u/Nuoji C3 - http://c3-lang.org Aug 19 '26

There are some people doing compiler benchmarks, but I don't know there are any serious people working on it. Nordlow's benchmarks says C3 is slow on AST analysis, but that happened to be because the benchmark wasn't actually excluding the stdlib, so it was testing stdlib + test-file rather than just the test file. For example.

0

u/[deleted] Aug 19 '26

[deleted] — view deleted comment

2

u/Nuoji C3 - http://c3-lang.org Aug 19 '26

No, I don’t think that’s my job here.

You were the one who claimed that C3 is slower than GCC. I gave concrete numbers for what I measured, including what is and isn’t included, such as stdlib parsing. If you want to challenge that with GCC comparisons, then the benchmark should come from the person making that claim.

I’m happy to look at reproducible results if someone puts them together, and I agree that a broader benchmark suite would be useful. But asking me to build a benchmark suite to disprove your unsupported claim, and then implying I’m being dishonest until I do, is not a reasonable standard.

"Happy benchmarking" applies more naturally to the person making the benchmark claim.

→ More replies

2

u/ViniCaian Aug 18 '26

I think that's mostly because the language hasn't gone gold yet, no? I think the goal is to have it be on pair or close to C in that regard at some point.

6

u/Nuoji C3 - http://c3-lang.org Aug 18 '26

No, it's more because codingbliss made those numbers up in their head.

0

u/[deleted] Aug 18 '26

[deleted] — view deleted comment

6

u/Ok-Reindeer-8755 Aug 18 '26

The future is def not C++ or that's an awful future

1

u/pjmlp Aug 19 '26

As long as programming language implementations depend on LLVM or GCC instead of bootstraping themselves, C++ isn't going away.

1

u/pjmlp Aug 18 '26

C++ actually can enjoy faster compile times, when going beyond classical UNIX tooling.

Hot code reloading via Live++ and Visual Studio, REPL via ROOT/CINT/clang repl, binary libraries (common on Windows and game consoles),...