The CppWrapper (and Boost.Python) approach is basically to do the hard work 
of the interfacing on the C++ side, so that Julia only has to work with 
ordinary C types and function pointers.    See also SWIG, which generates C 
shims and other glue for C++ code.   It's the traditional approach for 
calling C++ code from other languages, because C++'s design makes it very 
difficult to call directly.

As I understand it, Cxx.jl is different, and is pretty unique among dynamic 
languages.  It allows you to call *unmodified* C++ libraries directly using *no 
C/C++ glue*, with all the work being done on the Julia side, including 
instantiating C++ templates, classes, etcetera.  The key is Julia 0.4's 
staged functions, which allow code generation based on inferred types 
(necessary to know which C++ function to invoke) combined with Clang to 
decipher the C++ ABI.

The only drawback with Cxx.jl is that it requires a custom build of Julia 
to use a bleeding-edge version of LLVM, and hence it isn't for the 
faint-hearted at the moment.

Reply via email to