ferrosaur
ferrosaur derives statically-typed Rust code — à la wasm-bindgen — for
deno_core::JsRuntime to interface with your JavaScript code.
If you have:
// lib.js
export const
n === 0 ? 0 : n === 1 ? 1 : + ;
... and you write:
// lib.rs
use js;
;
... then you get:
// let rt: &mut JsRuntime;
let lib = main_module_init.await?;
let fib = lib.slow_fib?;
assert_eq!;
[!TIP]
This is like the inverse of
deno_core::op2:
#[op2]gives JavaScript programs easy access to your Rust implementation.- ferrosaur gives your Rust program easy access to JavaScript implementations.
License
This project is released under the Apache 2.0 License and the MIT License.