4 ms·
> super easy C/C++ FFI There's a HUGE difference between a C FFI and a C++ FFI. I doubt that Nim makes the latter easy (name mangling, exceptions, STL, ...).
by jhasse 8y ago
> super easy C/C++ FFI
There's a HUGE difference between a C FFI and a C++ FFI. I doubt that Nim makes the latter easy (name mangling, exceptions, STL, ...).
- dom96 8y agoYou're very right to doubt me. But it does make it easy, Nim compiles to C/C++/Objective C (exceptions are mapped to C++ exceptions in C++ mode). This gives it the ability to wrap all C++ libraries, Nim takes advantage of this to make wrapping easy, here is a (very) barebones wrapper for sfml as an example: https://github.com/dom96/nim-in-action-code/blob/master/Chapter8/sfml/sfml.nim https://github.com/dom96/nim-in-action-code/blob/master/Chap...
- jhasse 8y agoThanks for the link, I stand corrected! :)