Skip to content

oyd11/polyglot-ffi-example

Repository files navigation

polyglot-ffi-example

FFI - (Foreign function interface) (sometimes called 'interop') to and from a "C-style" - ABI [ https://en.wikipedia.org/wiki/Application_binary_interface ]

This is a collection of minimal examples - specifically of how to transfer Arrays of Data - and Text-Strings, back and forth between programming languages.

  • Out-of-the-box : Only MacOS version is probably running, it's a matter of .dylib vs .so extention to make it run on Linux (I'll add Dockerfiles and running versions)

These are usually small bridging code snippets, with some specifics. I use this as a testing template, detached from the complexities of a real project.

Directory structure:

  • [export-cpp] - exports an ABI from C++ (Build this first to import them from other places)
  • [import-julia06] - Julia lang 0.6
  • import-nodejs - javascript - using Node.js ffi, including async calls
  • import-nodejs-fastcall - javascript - using Node.js 'fastcall'
  • import-swift3 - swift 3

About

'extern "C"' style Foreign function interface - from shared library - to some dynamic languages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published