Skip to content

libpasta/pasta-bindings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross-language bindings for libpasta

This library is intended for developers wishing to extend or improve the existing language bindings for libpasta.

For existing language bindings, and ways to install in those languages, please see the information here.

SWIG and libpasta

The language bindings produced here are through using SWIG.

The following logic is used to produce the language bindings:

We define the C header file in pasta.h which corresponds to the Rust definitions from the libpasta-capi crate (included as a submodule for convenience).

This header file is now compatible with using SWIG, and the pasta.i file produces basic bindings with just the %include <pasta.h> line.

The rest of the pasta.i file is dedicated to language-specific requirements, and convenience code, such as automatically deallocating the Rust String objects required to call the library.

We produce code for each support language using the Makefile. In general, this runs SWIG over the definition file to produce wrapper code, and compiles it into a single pasta.so file (name depending on the language and system preferences), and language-specific code to use this library.

Current Status

The entire libpasta project is still in an early phase. These bindings are designed for ease of use, and early testing.

In the future, the goal is for libpasta to be a systems library, and thus the default assumption is that libpasta.so is installed. This can be tested with ldconfig -p | grep libpasta.

For initial ease of use, we also permit compiling libpasta statically, and packaged into the produced wrapper library. This is not ideal, but effective for early prototyping. To force use of the static compilation, make with the USE_STATIC flag, e.g. USE_STATIC=1 make ....

Currently these bindings are designed for x86_64-unknown-linux-gnu (as per Rust platform support), but we are trying to increase support to other platforms.