Example of rust-based shared library with language binding
- ruby: via danielpclark/rutie: “The Tie Between Ruby and Rust.”
- php: via davidcole1340/ext-php-rs: Bindings for the Zend API to build PHP extensions natively in Rust.
- python: via PyO3/pyo3: Rust bindings for the Python interpreter
- js: via rustwasm/wasm-bindgen: Facilitating high-level interactions between Wasm modules and JavaScript
pp RubyExample.reverse("apples")
# Build ruby binding
make build_ruby
# Debug ruby binding docker image
make bash_ruby
# Run ruby binding
make run_ruby
<?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
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
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