Look Ma, I put a compiler in the compiler

1 · Ponylang · June 20, 2026, 12:52 a.m.
Summary
Calling C from Pony is usually easy. You write the FFI declarations, you call the function, you're done. Sometimes it isn't that easy: you need to call a macro, so there's no symbol to bind to. Or you have to fill in a struct by hand before you can pass it in. Or the calling convention is one Pony's FFI can't express. C has all kinds of little oddities that don't line up with Pony. When you hit one of those oddities, it is time to reach for a shim: a small piece of C between Pony and the library...