All Projects → Dushistov → Flapigen Rs

Dushistov / Flapigen Rs

Licence: bsd-3-clause
Tool for connecting programs or libraries written in Rust with other languages

Programming Languages

java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language
rust
11053 projects
cpp
1120 projects

Projects that are alternatives of or similar to Flapigen Rs

java-cpp-example
Example of using C++ classes from Java. Showcases SWIG, JNA and JNI
Stars: ✭ 135 (-71.46%)
Mutual labels:  swig, jni
Pykcs11
PKCS#11 Wrapper for Python
Stars: ✭ 53 (-88.79%)
Mutual labels:  wrapper, swig
Inkwell
It's a New Kind of Wrapper for Exposing LLVM (Safely)
Stars: ✭ 732 (+54.76%)
Mutual labels:  wrapper, codegen
Jni.hpp
A modern, type-safe, header-only, C++14 wrapper for JNI
Stars: ✭ 313 (-33.83%)
Mutual labels:  wrapper, jni
Wiringpi Python
Unofficial Python-wrapped version of Gordon Henderson's WiringPi version 2.
Stars: ✭ 438 (-7.4%)
Mutual labels:  swig
Keepalive
Fighting against force-stop kill process on Android with binder ioctl / Android高级保活
Stars: ✭ 376 (-20.51%)
Mutual labels:  jni
Go Dotnet
Go wrapper for the .NET Core Runtime.
Stars: ✭ 369 (-21.99%)
Mutual labels:  wrapper
Pytorch Custom Cuda Tutorial
Tutorial for building a custom CUDA function for Pytorch
Stars: ✭ 369 (-21.99%)
Mutual labels:  wrapper
Seq2seqchatbots
A wrapper around tensor2tensor to flexibly train, interact, and generate data for neural chatbots.
Stars: ✭ 466 (-1.48%)
Mutual labels:  wrapper
Jni Rs
Rust bindings to the Java Native Interface — JNI
Stars: ✭ 456 (-3.59%)
Mutual labels:  jni
Jsstore
A complete IndexedDB wrapper with SQL like syntax.
Stars: ✭ 430 (-9.09%)
Mutual labels:  wrapper
Fmj
FMJ (FFMpeg for Java)。通过Java调用FFMpeg命令的方式来对音视频进行处理(获取信息、截图等等)。
Stars: ✭ 379 (-19.87%)
Mutual labels:  jni
Docker Aosp
🏗 Minimal Android AOSP build environment with handy automation wrapper scripts
Stars: ✭ 440 (-6.98%)
Mutual labels:  wrapper
Android Api Securekeys
Store data in a simple and secure way
Stars: ✭ 372 (-21.35%)
Mutual labels:  jni
Simpleitk
SimpleITK: a layer built on top of the Insight Toolkit (ITK), intended to simplify and facilitate ITK's use in rapid prototyping, education and interpreted languages.
Stars: ✭ 458 (-3.17%)
Mutual labels:  swig
Sparqlwrapper
A wrapper for a remote SPARQL endpoint
Stars: ✭ 365 (-22.83%)
Mutual labels:  wrapper
Scfacebook
The SCFacebook 4.1 is a simple and cleaner to use the api facebook-ios-sdk Objective-C Wrapper (https://github.com/facebook/facebook-ios-sdk) to perform login, get friends list, information about the user and posting on the wall with ^Block for iPhone. Suporte 4.71 FBSDKCoreKit, FBSDKShareKit and FBSDKLoginKit. Facebook SDK
Stars: ✭ 420 (-11.21%)
Mutual labels:  wrapper
Nswag
The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
Stars: ✭ 4,825 (+920.08%)
Mutual labels:  codegen
Intel Cmt Cat
User space software for Intel(R) Resource Director Technology
Stars: ✭ 400 (-15.43%)
Mutual labels:  swig
Aspect Injector
AOP framework for .NET (c#, vb, etc)
Stars: ✭ 398 (-15.86%)
Mutual labels:  wrapper

flapigen Build Status License Rust Documentation

Tool for connecting programs or libraries written in Rust with other languages. Foreign language api generator - flapigen. Former name rust_swig was changed to not confuse with swig. Currently implemented support for C++ and Java, but you can write support for any language of your choice. For an instruction how to integrate flapigen with your project look here.

Suppose you have the following Rust code:

struct Foo {
    data: i32
}

impl Foo {
    fn new(val: i32) -> Foo {
        Foo{data: val}
    }

    fn f(&self, a: i32, b: i32) -> i32 {
        self.data + a + b
    }

    fn set_field(&mut self, v: i32) {
        self.data = v;
    }
}

fn f2(a: i32) -> i32 {
    a * 2
}

and you want to write in Java something like this:

Foo foo = new Foo(5);
int res = foo.f(1, 2);
assert res == 8;

or in C++ something like this:

Foo foo(5);
int res = foo.f(1, 2);
assert(res == 8);

In order to implement it flapigen suggests the following functionality, in Rust project you write (in Rust language):

foreign_class!(class Foo {
    self_type Foo;
    constructor Foo::new(_: i32) -> Foo;
    fn Foo::set_field(&mut self, _: i32);
    fn Foo::f(&self, _: i32, _: i32) -> i32;
    fn f2(_: i32) -> i32;
});

and that's all, as a result flapigen generates JNI wrappers for Rust functions and Java code to call these JNI functions or generates C compatible wrappers in case of C++ and C++ code to call these C functions.

Users Guide

📚 Read the flapigen users guide here! 📚

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].