frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://kefir.protopopov.lv/posts/announce0.html
27•jprotopopov•3d ago

Comments

renehsz•1d 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 ;-)

jprotopopov•9h ago
(I thought that the announcement has completely faded, so haven't even checked the replies).

I'll immediately reveal some issues with the project. On the compilation speed, it is unfortunately atrocious. There are multiple reasons for that:

1. Initially the compiler was much less ambitious, and was basically generating stack-based threaded code, so everything was much simpler. I have managed to make it more reasonable in terms of code generation (now it has real code generator, optimization pipeline), but there is still huge legacy in the code base. There is a whole layer of stack-based IR which is translated from the AST, and then transformed into equivalent SSA-based IR. Removing that means rewriting the whole translator part, for which I am not ready.

2. You've outlined some appealing points (standard compliance, debug info, optimization passes), but again -- this came at the expense of being over-engineered and bloated inside. Whenever, I have to implement some new feature, I hedge and over-abstract to keep it manageable/avoid hitting unanticipated problems in the future. This has served quite well in terms of development velocity and extending the scope (many parts have not seen complete refactoring since the initial implementation in 2020/2021, I just build up), but efficiency of the compiler itself suffered.

3. I have not particularly prioritized this issue. Basically, I start optimizing the compiler itself only when something gets too unreasonable (either, in terms of run time, or memory). There are all kinds of inefficiencies, O(n^2) algorithms and such simply because I knew that I would be able to swap that part out should that be necessary, but never actually did. I think the compiler efficiency has been the most de-prioritized concern for me.

Basically, if one is concerned with compilation speed, it is literally better to pick gcc, not even talking about something like tcc. Kefir is abysmal in that respect. I terms, of code base size, it is 144k (sans tests, 260k in total) which is again not exactly small. It's manageable for me, but not hacker-friendly.

With respect to marketing, I am kind of torn. I cannot work on this thing full time, unless somebody is ready to provide sufficient full-time funding for myself and also other expenses (machines for tests, etc). Otherwise, I'll just increase the workload on myself and reduce the amount of time I can spend actually working on the code, so it'll probably be net loss for the project. Either way, for now I treat it closer to an art project than a production tool.

As for compiled code performance, I have addressed it here https://lobste.rs/s/fxyvwf -- it's better than, say, tcc, but nowhere near well-established compilers. I think this is reasonable to expect, and the exact ways to improve that a bit are also clear to me, it's only question of development effort

P.S. JKU is a great school, although by the time I enrolled there the project has already been on the verge of bootstrapping itself.

EDIT: formatting

oguz-ismail•16h 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.
jprotopopov•9h ago
I have addressed compiler inefficiency in the sibling comment. This is indeed a problem. Empty arrays of such size should be compile-able (there is sparse representation for arrays). However, I would say that this use case is not particularly practical, at least in none of the projects from my test suite this has been an issue.
oguz-ismail•9h ago
Good work either way. Congrats!

Legal win

https://ma.tt/2025/09/legal-win/
56•pentagrama•1h ago•17 comments

UTF-8 is a brilliant design

https://iamvishnu.com/posts/utf8-is-brilliant-design
431•vishnuharidas•8h ago•177 comments

Chatbox app is back on the US app store

https://github.com/chatboxai/chatbox/issues/2644
23•themez•1h ago•3 comments

Meow: Yet another modal editing on Emacs

https://github.com/meow-edit/meow
51•Bogdanp•2h ago•5 comments

QGIS is a free, open-source, cross platform geographical information system

https://github.com/qgis/QGIS
332•rcarmo•10h ago•86 comments

FFglitch, FFmpeg fork for glitch art

https://ffglitch.org/gallery/
93•captain_bender•5h ago•15 comments

Life, work, death and the peasant: Rent and extraction

https://acoup.blog/2025/09/12/collections-life-work-death-and-the-peasant-part-ivc-rent-and-extra...
75•baud147258•2h ago•7 comments

I used standard Emacs extension-points to extend org-mode

https://edoput.it/2025/04/16/emacs-paradigm-shift.html
132•Karrot_Kream•6h ago•6 comments

Many hard LeetCode problems are easy constraint problems

https://buttondown.com/hillelwayne/archive/many-hard-leetcode-problems-are-easy-constraint/
436•mpweiher•12h ago•373 comments

The treasury is expanding the Patriot Act to attack Bitcoin self custody

https://www.tftc.io/treasury-iexpanding-patriot-act/
624•bilsbie•15h ago•456 comments

Tips for installing Windows 98 in QEMU/UTM

https://sporks.space/2025/08/28/tips-for-installing-windows-98-in-qemu-utm/
42•Bogdanp•4h ago•5 comments

EU court rules nuclear energy is clean energy

https://www.weplanet.org/post/eu-court-rules-nuclear-energy-is-clean-energy
667•mpweiher•9h ago•507 comments

California lawmakers pass SB 79, housing bill that brings dense housing

https://www.latimes.com/california/story/2025-09-12/california-lawmakers-pass-sb-79-housing-bill-...
69•mji•1h ago•15 comments

Antlr-Ng Parser Generator

https://www.antlr-ng.org/
11•djoldman•3d ago•2 comments

OCI Registry Explorer

https://oci.dag.dev/
4•jcbhmr•39m ago•0 comments

3D modeling with paper

https://www.arvinpoddar.com/blog/3d-modeling-with-paper
256•joshuawootonn•13h ago•39 comments

Automate compile_flags for C/C++ projects on the Zig build system

https://simonhartcher.com/posts/2025-09-08-announcing-compile-flagz/
23•deevus•2d ago•5 comments

Discovery of a new satellite or ring arc around Quaoar

https://phys.org/news/2025-09-discovery-moon-orbiting-mysterious-distant.html
19•wglb•1d ago•2 comments

Unauthorized Windows/386

https://virtuallyfun.com/2025/09/06/unauthorized-windows-386/
50•Bogdanp•3d ago•6 comments

Reduce bandwidth costs with dm-cache: fast local SSD caching for network storage

https://devcenter.upsun.com/posts/cut-aws-bandwidth-costs-95-with-dm-cache/
32•tlar•3d ago•11 comments

Rust: A quest for performant, reliable software [video]

https://www.youtube.com/watch?v=k_-6KI3m31M
109•raphlinus•19h ago•36 comments

How FOSS Projects Handle Legal Takedown Requests

https://f-droid.org/2025/09/10/how-foss-projects-handle-legal-takedown-requests.html
97•mkesper•9h ago•8 comments

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

https://kefir.protopopov.lv/posts/announce0.html
27•jprotopopov•3d ago•5 comments

OpenAI Grove

https://openai.com/index/openai-grove/
108•manveerc•11h ago•116 comments

Corporations are trying to hide job openings from US citizens

https://thehill.com/opinion/finance/5498346-corporate-america-has-been-trying-to-hide-job-opening...
431•b_mc2•11h ago•323 comments

Proton Mail suspended journalist accounts at request of cybersecurity agency

https://theintercept.com/2025/09/12/proton-mail-journalist-accounts-suspended/
194•lehi•6h ago•87 comments

Show HN: Aris – a free AI-powered answer engine for kids

https://www.aris.chat
22•andrewdug•5h ago•34 comments

Windows-Use: an AI agent that interacts with Windows at GUI layer

https://github.com/CursorTouch/Windows-Use
107•djhu9•4d ago•20 comments

Oq: Terminal OpenAPI Spec Viewer

https://github.com/plutov/oq
98•der_gopher•12h ago•12 comments

Real-time AI hallucination detection with timeplus: A chess example

https://www.timeplus.com/post/ai-chess-hallucination-detection
12•gangtao•3d ago•6 comments