[erlang-questions] [ANN] nifpp: C++11 wrappers for NIF API

Daniel Goertzen <>
Wed Mar 28 05:22:20 CEST 2012


I'm pleased to announce nifpp, C++11 wrappers for the Erlang NIF API.
 nifpp provides...

- Conversions to/from C++ container types, namely tuple, vector, list,
deque, set, and multiset.
- A safe resource wrapper so that any type can be created as a resource.

Source and documentation here:
https://github.com/goertzenator/nifpp

I need to polish, test and document binary support, but the rest of it is
in good shape so I'm sharing it now.

Below are links to C and C++ versions of an identical tuple manipulation
operation.  The C++ version is [imho] easier to understand, and it actually
benchmarks slightly faster than the C version on most of my runs.

https://github.com/goertzenator/nifpp/blob/master/examples/tuple_twiddle_c.c
https://github.com/goertzenator/nifpp/blob/master/examples/tuple_twiddle_cpp.cpp



And here is an example of resource wrapping.  The Boost class
"mapped_file_source" which provides portable file memory mapping is
instantiated as an Erlang resource.

https://github.com/goertzenator/nifpp/blob/master/examples/mmap_binary.cpp



All feedback appreciated.

Thanks,
Dan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120327/d63a022c/attachment.html>


More information about the erlang-questions mailing list