subuta / play-with-rust-binding

Example of rust-based shared library with language binding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

play-with-rust-binding

Example of rust-based shared library with language binding

Bindings

How to develop "ruby binding"

pp RubyExample.reverse("apples")
# Build ruby binding
make build_ruby

# Debug ruby binding docker image
make bash_ruby

# Run ruby binding
make run_ruby

How to develop "php binding"

<?php

var_dump(reverse("apples"));
# Build php binding
make build_php

# Debug php binding docker image
make bash_php

# Run php binding
make run_php

How to develop "python binding"

print(python_binding.reverse("apples"))
# Build python binding
make build_python

# Debug python binding docker image
make bash_python

# Run python binding
make run_python

How to develop "js binding"

console.log(`reverse('apples') = ${pkg.reverse('apples')}`)
# Build js binding
make build_js

# Debug js binding docker image
make bash_js

# Run js binding on Node.js (in server JS)
make run_js

# Run js binding(with "wasm") in the browser
make run_browser_js
open http://localhost:8080

About

Example of rust-based shared library with language binding

License:MIT License


Languages

Language:Dockerfile 30.5%Language:Ruby 24.6%Language:Makefile 17.3%Language:Rust 12.1%Language:JavaScript 10.9%Language:Shell 3.8%Language:Python 0.5%Language:PHP 0.3%