Open SeanTAllen opened 8 years ago
I think that is reasonable for now
Two more for this list
FFI functions raising errors talks about how Pony code should declare and handle errors from C but doesn't talk about how the C side should raise an error. We're guessing this is via pony_error()
with notes in ponyc/src/libponyrt/pony.h
and some examples in ponyc/src/libponyrt/lang/time.c
, ponyc/src/libponyrt/lang/posix_except.c
, and ponyc/src/libponyrt/lang/socket.c
.
Linking to C Libraries doesn't mention C++. Maybe another section? I've had some success with this method, happy to discuss.
Write a C wrapper to manage C++ object storage and method invocations. This wrapper would FFI to Pony as normal.
Make sure the wrapper functions which need to be seen in Pony FFI are declared extern "C" { ... }
.
** When linking with GNU tools, be sure to use ponyc --linker g++
because the C++ mangled names and also because of the runtime environment is needed AND be sure to have libstdc++
on your system
I added an issue (#83) for wanting a section about callbacks, but maybe that should be in here?