Remix.run Logo
palata 39 minutes ago

To me, the value of C is the interop story.

Is there a modern language with ABI stability that can replace C for that? As in, you can wrap anything with a C API and be sure that it can be called from any other language easily?

tialaramex 20 minutes ago | parent [-]

The interop story is largely a self-fulfilling prophecy. When you start to explore the edges of C ABI compatibility you discover that er... there's actually no ABI compatibility unless somebody did the work and they never did the work.

Two C implementations on the same CPU with 64-bit integers both, unsurprisingly, think 64-bit integers work the same way - because that was obvious. Now, how about 128-bit integers. Ah, turns out implementation A thought they go (lo,hi) but B thought they're obviously (hi,lo) so these types have different ABI between C implementations...

It's not obvious because most software which cares about Windows also needs the Windows API and so couldn't be non-Windows software, but Windows people have a different rule for how 64-bit works than everybody else, LLP64 versus the usual LP64. And there were other options such as ILP64 they're just all basically dead.