Kefir: Solo-developed full C17/C23 compiler with extensive validation

kefir.protopopov.lv

41 points by jprotopopov 4 days ago


renehsz - a day ago

Wow, hats off to you! This is one of the most impressive solo projects I've seen in a while!

Making a toy C compiler isn't rocket science, but developing one that's complete and production-ready is whole nother story. AFAICT, Kefir fits into the latter category:

- C17/C23 compliance

- x86_64 codegen

- debug info gen

- SSA-based optimization passes (the most important ones)

- has a widely-compatible cc cli

- is extensively tested/fuzzed

Some advantages compared to the big three (GCC, Clang, MSVC):

- It's fairly small and simple

- That means it's understandable and predictable - no surprises in terms of what it can and cannot do (regarding optimizations in particular)

- Compilation is probably very fast (although I haven't done any benchmarking)

- It could be modified or extended fairly easily

There might be real interest in this compiler from people/companies who

- value predictability and stability very highly

- want to be in control of their entire software supply chain (including the build tools)

- simply want a faster compiler for their debug builds

Think security/high assurance people, even the suckless or handmade community might be interested.

So it's time to market this thing! Get some momentum going! It would be too sad to see this project fade away in silence. Announce it in lots of places, maybe get it on Compiler Explorer, etc. (I'm not saying that you have to do this, of course. But some people could genuinely benefit from Kefir.)

P.S. Seems like JKU has earned its reputation as one of the best CS schools in Austria ;-)

oguz-ismail - 20 hours ago

Cool project. Unlike tcc and cproc though kefir doesn't seem very good at handling big arrays. This

    $ kefir -c - <<x
    int a[] = {
    $(seq 10000000 | tr '\n' ,)
    };
    x
allocates gigabytes of memory and eventually crashes WSL on my machine.