alt.hn

4/28/2026 at 7:10:14 PM

CJIT: C, Just in Time

https://dyne.org/cjit/

by smartmic

4/28/2026 at 8:15:30 PM

Related:

Show HN: CJIT, a single-binary C compiler that can self host - https://news.ycombinator.com/item?id=47751458 - April 2026 (1 comment)

C, Just in Time - https://news.ycombinator.com/item?id=42246209 - Nov 2024 (7 comments)

(Pity the Show HN didn't get attention - we'll email the author)

by dang

4/29/2026 at 11:45:55 AM

hi! matter of timing I guess, development isn't stopping :^) a friend just prompted me to look at unx - fun to see if it all works with cjit

by jaromilrojo

4/28/2026 at 9:20:32 PM

Pair this with Fil-C(https://fil-c.org/) and now you have C but as a truly bonafide scripting language.

by taylorallred

4/28/2026 at 11:21:10 PM

The world-class script munging capabilities and rapid prototyping capabilities of C, combined with the durable performance of your favorite scripting language. A match made in heaven for operational scripts

by rtpg

4/28/2026 at 11:15:19 PM

Which sounds a lot like the worst of all worlds.

by simonask

4/29/2026 at 12:52:51 AM

Party pooper.

by whatever120

4/29/2026 at 12:54:43 AM

[dead]

by cindyllm

4/28/2026 at 9:16:20 PM

Cool idea.

I was wondering why the release explicitly is `cjit-x86_64-ubuntu-24.04` instead of generic linux, but it does in fact appear to not work on Arch:

`tcc: error: file '/lib/x86_64-linux-gnu/libgcc_s.so.1' not found`

I'm guessing that's due to a `dlopen` since it's not listed by `ldd`

The TUI demos work great, but I couldn't get the SDL examples to resolve all the missing symbols after trying for a bit.

by apitman

4/29/2026 at 12:19:47 AM

> What's different between tcc -run and CJIT? >The main difference is in usability.

> CJIT improves three main UX aspects for now:

> It works as a single executable file which embeds the TinyCC compiler, all its headers and its standard library. This way there is no need to install anything system wide, check paths and setup build folders.

> It supports adding multiple files into one execution: can accept wildcards to ingest anything that is a C source, a pre-compiled object or a shared library. The symbols exported by each file will be visible to all during the same execution.

> It finds automatically common system libraries for each target platform, avoiding the need to repeat these settings and look for the right paths.

by tnelsond4

4/29/2026 at 4:12:18 AM

That read like a supply-chain attack gold mine if you ask me.

by fuhsnn

4/29/2026 at 7:51:55 AM

It's inspired by Terry Davis who didn't believe in sandboxes and security, he wanted to just run code and write code. It's your responsibility to read the code, :-P

by tnelsond4

4/28/2026 at 7:40:00 PM

Looks interesting and fun, but in no instance of any C compiler I've come across is the "classic example" of "hello, world" using `fprintf(stderr, ...)`

To each their own I guess.

by michaelcampbell

4/28/2026 at 9:13:20 PM

Give io buffering an inch and it will take a mile

by apitman

4/29/2026 at 11:23:49 AM

I give you `if (0 > fdprintf (STDERR_FILENO, ...))` instead.

But on a serious matter, it's a good thing to tell a beginner that diagnostics belong on stderr, not stdout.

by 1718627440

4/29/2026 at 2:59:44 PM

The real classic is from The C Programming Language (where I saw it) and is:

main( ) { printf("hello, world"); }

by NetMageSCW

4/28/2026 at 10:39:29 PM

> CJIT is not a tracing or adaptive JIT in the VM sense. It does not interpret first and optimize hot paths later.

> CJIT uses TinyCC to compile C quickly, often in memory, and can execute the resulting code immediately.

Wait, what's the difference between this and just using tinycc directly?

   cat program.c | tcc -run -
Happy to be proven wrong here, since the project has been around for a couple years. It doesn't appear to just be a random AI one-shot thing.

by slopinthebag

4/29/2026 at 12:39:28 AM

Julia uses a model similar to this. The main advantage is that you can interact much more easily if you have a REPL running where you can do things (assign variables load data etc) and then define/try out new code on that data.

by adgjlsfhk1

4/29/2026 at 9:02:33 AM

This model traces back to Lisp and how BASIC was originally designed at Dartmouth (the pure interpreter approach was a solution to fit it into 8 bit home computers).

The best tooling approach is a mix of interpreter, dynamic and ahead of time compilers, it is a pity that not all toolchains provide this.

by pjmlp

4/29/2026 at 12:07:39 AM

You may be disappointed by the FAQ then https://dyne.org/cjit/faq.html (other than it really isn't an AI thing).

by zamadatix

4/29/2026 at 5:21:59 AM

I wonder whether CJiT can compile itself a-la GCC and LLVM. FAQs don't mention this and maybe the next weekend I will try to boot cjit with cjit itself.

by notorandit

4/28/2026 at 9:04:53 PM

> inspired by HolyC by Terry Davis

Definitely was not expecting this reference.

https://en.wikipedia.org/wiki/TempleOS#HolyC

https://en.wikipedia.org/wiki/Terry_A._Davis

by omoikane

4/28/2026 at 9:32:24 PM

I’m not surprised by it, but I am confused as I do not see anything that reminds me of TempleOS, HolyC, or Davis. If anything, this is just pushing the tcc —run functionality one step further.

by BirAdam

4/28/2026 at 11:47:27 PM

probably because the shell on TempleOS is actually a HolyC REPL, and HolyC is JIT compiled.

by jovial_cavalier

4/28/2026 at 8:46:15 PM

Did you use Codex 5.4 for the web design? :p I think Codex tends to do very similar designs, could be completely mistaken tho

by gosukiwi

4/28/2026 at 9:18:16 PM

The source for the site is here: https://github.com/dyne/cjit/tree/main/docs. It's a VitePress site with a custom theme. Glancing through the code, I don't see any obvious signs of LLM coding. It also definitely wasn't created with Codex specifically, because according to the commit history, the first version of the site was in late 2024, months before Codex even released.

by ethmarks

4/28/2026 at 8:59:45 PM

Looks like a generic static site generator page to me. I'd be surprised if dyne folks used a closed system like Codex specifically.

by zamadatix

4/29/2026 at 2:51:32 PM

You should release a static version of it.

by zoobab

4/28/2026 at 8:56:59 PM

Sweet project! I will give this a go today :)

by grebc

4/28/2026 at 9:15:06 PM

The site visually feels "compressed" due to the font used? It's a bit jarring. The tutorial link in the header nav doesn't go anywhere.

by theogravity

4/29/2026 at 1:42:51 PM

It goes to https://dyne.org/cjit/tutorial.html for me, and very much works as I would expect it to (chromium engine browser, MacOS)

by michaelcampbell

4/28/2026 at 9:31:14 PM

Inspired by Terry. But does it glow?

by jsLavaGoat

4/28/2026 at 7:28:58 PM

https://dyne.org/cjit/graphics.html#cjit-for-graphical-appli...

> Be welcome to the exciting world of graphical C applications using SDL (Simple DirectMedia Layer). SDL, originally developed by Sam Lantinga in 1998...

That's batteries included.

by uticus

4/28/2026 at 9:28:58 PM

It links to the system SDL, on Linux at least.

by apitman

4/28/2026 at 10:41:42 PM

> inspired by HolyC by Terry Davis

...in what way? o.O

by wavemode

4/29/2026 at 2:49:54 AM

For the uninitiated who didn't watch Terry's streams, HolyC is both an AOT and JIT language, but the JIT was in some ways much more rudimentary and in some ways much more powerful than a typical JIT compiler. Like this CJIT project, it basically could dynamically link and compile source code, spit the assembly into memory and proceed to immediately execute it. In fact, the system shell was literally JIT compiled HolyC. Which also meant you can do fun things like call kernel functions directly from the command line.

by mightyham