by binarynate · 5y ago · 0 comments
Or just integrate with C++ code by exposing it through C linkage with `extern "C" {}`. Sure, C is the de facto lingua franca of programming languages, but that doesn't seem like a pragmatic reason to choose C over a different language that may be better for the job. Also, C++ has a massive ecosystem.
Nope. Been there. Done that. Got the scars.
For example, what happens when an exception gets thrown on the other side of that "extern C"? Yeah, undefined.
The problem is that if you're using C++, you get the C++ machinery--allocators, exceptions, etc.--and you can't dodge it.