Comment

Comment by tenfingers

Note that C++ has "extern C" for the same purpose, and many people do not seem to be aware of it.

You can perfectly write a C++ library and expose a C-safe subset. I've done so many times.

The problem arises if you need to expose objects (with virtual methods), which C obviously doesn't have as the ffi is basically restricted to plain functions and record types.

parent tenfingers 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton