Giter VIP home page Giter VIP logo

shadowkun / diplomat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rust-diplomat/diplomat

0.0 1.0 0.0 1.03 MB

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Home Page: https://rust-diplomat.github.io/book/

License: Other

Shell 0.03% JavaScript 5.33% C++ 23.69% Python 0.18% C 0.28% C# 8.86% Rust 60.45% TypeScript 0.55% Makefile 0.40% HTML 0.07% Batchfile 0.16%

diplomat's Introduction

Diplomat

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

Diplomat supports languages through a plugin interface that makes it easy to add support for your favourite language. See tool/src/{c, cpp, js} for examples of existing language plugins.

Installation

First, install the CLI tool for generating bindings:

$ cargo install diplomat-tool

Then, add the Diplomat macro and runtime as dependencies to your project:

diplomat = "0.4.0"
diplomat-runtime = "0.4.0"

Getting Started

Documentation on how to use Diplomat can be found in the book.

Architecture

See the design doc for more details.

Building and Testing

Simply run cargo build to build all the libraries and compile an example. To run unit tests, run cargo test.

Diplomat makes use of snapshot tests to check macro and code generation logic. When code generation logic changes and the snapshots need to be updated, run cargo insta review (run cargo install cargo-insta to get the tool) to view the changes and update the snapshots.

diplomat's People

Contributors

cbenoit avatar dminor avatar gregtatum avatar kaidanfullerton avatar manishearth avatar nciric avatar qnnokabayashi avatar robertbastian avatar sffc avatar shadaj avatar weiznich avatar wtgtybhertgeghgtwtg avatar zbraniecki avatar

Watchers

 avatar

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.