OpenBSD has two new C compilers: chibicc and kefir
briancallahan.net
briancallahan.net
- Kefir name is simply a reference to milk drink, no other connotation is intended. Updated project README with this information.
- The compiler is indeed quite primitive, especially, in terms of code generation. My main goal was implementing a C compiler that is reasonably compliant with language standard and platform ABIs, so I decided to simply ignore any performance considerations as I wouldn't compete with well-established compilers anyway.
Usage of threaded code is also caused by the same reason -- it is very simple to obtain assembly from intermediate representation when the assembly is mostly composed from references to runtime routines. Even without considering more sophisticated schemes of code generation, current approach is not optimal -- threaded code encoding scheme is very wasteful in terms of generated code (which was also noted in the blog post) and has awful runtime performance.
- I have tried to keep compiler compliant with the standard as well as compatible some of widespread C extensions (with some exceptions which I listed in README). Will try to address compilation errors found by Brian. Unfortunately, currently I do not have much time to work on the compiler. Identifying and fixing such bugs might also be quite tedious, so I expect that there are enough unnoticed compatibility problems there.
- Patches implementing OpenBSD support are appreciated. I plan to integrate those into the main code tree at some point.
Good times.
"Usage is strongly discouraged. This is [an] experimental project which is not meant for production purposes."
> That was all the encouragement I needed.
I love this
Garbage-quality projects don't bother putting such warnings. They might even not be aware they are garbage.
(/s)
I'm sure there must be a term for this... known incompetence > unknown incompetence.
Doing your own research on complicated products is hard, that's why we as a community seem to move on to things via trial and error.
Like binary C-Operators will only work on the first 8 bits, the rest is up there and needs to be shifted in and out.. basically work it out yourselve, once it wont work.
Then explain to the manager, that his hot project tooling from the megacorp upstream was basically license-brokken copy pasted garbage from some hobbyist half way around the world). And get a no, when asking for at least posting the patches back.
Or the "Working feature" which is just some api header, going into a inlined binary blob returning some constant. Which is just some flytrap to get you to drive by develop it for them. Twelve angry part time devs, make up one full working project.
The only professional in some industries is looking at you every morning from the mirror, begging for a mercy killing.
That got dark quickly. Otherwise, so true
I agree that if you think "Wrong root word. You're thinking of Kafir." is acceptable, so too would be the semicolon usage, which is why I said "arguably incorrect" rather than just "incorrect"
"[That is the] wrong root word; You're thinking of Kafir".
Since in the first clause, it seems like the intention is to point to the previous comment that is the matter at hand, which was actually written not just thought about. However, other readings might be possible.
The previous poster’s usage of a semicolon in this instance was, in fact, correct.
I'm glad that someone finally admitted that C is crap. Clearly we need fewer C compilers, not more of them! Embrace Smalltalk!
----
Aside: semicolons are pretty great once one learns to wield them. Try it; you'll like it. Just think of it as a shorter pause than a period, but longer than a comma.
> one of the languages I speak
why would i care which languages you speak
you are not me
i am not you
neither of us are everyone else
>try it
perhaps instead of me doing any of that, you could simply stop arrogating reflexively in your internet comments and presuming to know the inner contents of others' minds (you do not)
>semicolons
the purpose of your original reply was to condescend in typical nerdsplaining fashion. the reason my reply to you, in turn, was written like it was, including the side mention of semicolons, was to escalate abruptly and unambiguously, such that there was no ambiguity as to what i thought of the situation. i was expressing contempt. it's merely a circumstantial convenience that semicolons do happen to be dogshit punctuation used as epistemic crutch notation in prose
> [...] if the code kefir produces is correct, then it is amazing that one person was able to create a complete C17 compiler and that fact should be celebrated.
> I'll admit this is not something I would have thought of but it appears to work just fine.
They do two releases per year on a schedule.
That said, OpenBSD does introduce new stuff often. Over the years, they've periodically rewritten a handful of crusty old daemons for example.
text data bss dec hex
753670 40034 29848 823552 c9100
> And here are the numbers for kefir: text data bss dec hex
2374884 12071 30120 2417075 24e1b3
These are behemoths; especially the latter. Only compared to the grotesquelly aberrant code sizes of GCC and its ilk does this look "small".(The numbers in fact give me a dollop confidence that these are might be substantially more than toys.)