The Fil-C Optimized Calling Convention

A one-man coding moonshot says bad calls can’t break it — and commenters are stunned

TLDR: Fil-C claims it can stop or safely handle the kind of bad function calls that normally cause nasty C-language bugs, while staying fast when code behaves. Commenters were split between being amazed this is largely a one-person project and demanding to know who it’s really for in the real world.

This wasn’t just a dry programming write-up — it turned into a mini fan club, a mini interrogation, and a mini existential crisis all at once. The big claim behind Fil-C is wild in plain English: even if code calls a function the wrong way, mixes up what kind of data it is, or generally behaves like a menace, the system tries to either stop the disaster with a panic or make the result predictable instead of letting memory bugs run loose. In the normal, well-behaved case, it’s also supposed to stay fast. That combo — safety without turning everything into sludge — is what got people staring.

The strongest reaction? Straight-up disbelief that this is largely the work of one person, Filip Pizlo. One commenter basically did the internet version of a double take: wait, this is a personal passion project? That awe set the tone, with others praising the project’s clever pointer tricks and even passing around a video from Pizlo himself like receipts in a group chat.

But the comments weren’t all applause emojis. One camp asked the brutal question: what is this actually for? Another pushed on whether language runtimes would have to drown in endless function declarations just to play nicely. And then there was the practical crowd, wondering if the whole thing depends too much on threads. So yes, the vibe was part “genius alert,” part “show me the use case,” and part “this sounds amazing, but who exactly is signing up for the headache?”

Key Points

  • Fil-C’s calling convention is designed to remain memory-safe even when function calls are made with wrong signatures, wrong argument counts, wrong types, or mismatched module imports and exports.
  • In common cases, Fil-C compiles calls efficiently using a register-based convention that passes the current thread pointer as the first argument.
  • Pointer arguments are not revalidated as declared types at call entry in the optimized path, but pointer use still enforces capability and bounds checks when dereferenced.
  • If a function signature changes incompatibly, Fil-C either raises a panic or applies well-defined GIMSO semantics such as bitwise casting.
  • The article explains three layers of the design: a generic calling convention, a register-calling optimization, and direct-call optimizations, with the generic model serving as the semantic baseline and fallback.

Hottest takes

"If so, that's amazing." — aniviacat
"Pretty interesting, but what’s the reason of being for Fil-C?" — tines
"That quickly explodes into hundreds" — jancsika
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.