Code Monkey home page Code Monkey logo

autoffi's Introduction

AutoFFI

Travis CI Build status

AutoFFI is a way to call compiled code from higher-level languages, such as scripting languages. This repository contains an analyser which generates a file containing metadata. This metadata in turn is neccessary for automatically connecting to a C library.

Help Wanted

Do you like compilers? Do you know LLVM? Would you like to be able to call C code directly without the hassle of binding? Then help us out! Check out the issues to get an idea of what needs to be done and file a pull request whenever you like.

Installation

Linux

We provide binaries that are built by our build system whenever a new release arrives. You can download them to the releases section. Simply symlink the binaries somewhere into your $PATH.

Warning: the additional files must be placed near the executable so that the analyser might be able to find them. Therefore, we recommend symlinking.

OS X

The easiest way to install the AutoFFI compiler is through Homebrew.

Note: this method is not supported yet

$ brew install autoffi/autoffi/autoffi

Usage

$ affc myprog.c --include myprog.c > api.json
  • quiet: do not emit Clang diagnostics while compiling
  • include: include exported symbols that reside within this file. Usually these are the header files of the project.
  • include-hidden: include hidden symbols in the generated output. If you plan to connect to the ABI, this is almost never what you want.
  • include-protected: include symbols that have been marked as protected.

Generates a special AST from a set of sources. For more information, read the example.

Options:

  • include: one or more paths of which the resulting AST will be generated
  • exclude: one or more path that will not be included in the generated AST

Limitations

Garbage Collection

AutoFFI allows you to call low-level procedures as is, without any fancy things such as garbage collection. In order to achieve that you will still have to write your own code.

Credits

  • Anthony Green for his marvellous libffi

autoffi's People

Contributors

samvv avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

happy-ferret

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.