Show HN: CJIT, a single-binary C compiler that can self host

dyne.org

7 points by jaromilrojo 2 weeks ago

CJIT started as a hobby project around Fabrice Bellard’s tinyCC and slowly grew into something much more practical. It is now a small portable C compiler and runner that works across Linux, macOS, and Windows, can self host, and is packaged as a single executable.

What mattered most to me was keeping the barrier to entry low. You can take one small binary, drop it onto a system, and compile or run C code using the libraries already available there, without setting up a full toolchain or installing a large stack of dependencies.

I find that useful for quick prototyping, testing, auditing, learning, and generally exploring real systems with less friction. The codebase also reached a point where it feels solid and maintainable, not just experimental.

It is still a small project, and I want to keep it that way: simple, useful, and easy to carry around.

A fun extra: it works nicely with raylib as well.

Interested in feedback from people here, especially on the single-binary approach and whether this kind of tool feels useful in practice.

Rochus 2 weeks ago

Cool. What is the primary use case? What features in particular make it more useful than TCC alone? TCC as such is looking for the standard C libraries on the system. How do you handle this with your approach?