3 ms·
> That means dumping C++. Or just integrate with C++ code by exposing it through C linkage with `extern "C" {}`. Sure, C is the de facto lingua franca of progr
by binarynate 5y ago
> That means dumping C++.
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.
- bsder 5y ago> Or just integrate with C++ code by exposing it through C linkage with `extern "C" {}`. 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.
- pjmlp 5y agoExcept that libc you are using, most likely was implemented in C++ with extern "C", unless using a pre-historic C compiler.