You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Marshalling of Rust functions/types like with #[wasm-bindgen] attributes?聽#220
Btw, I have another question:
Is this crate the least-opinionated-possible layer on top of deno to make it useable inside a Rust host?
In other words, would it make sense for me to use deno directly or always this crate, if my goal is to have an embedded JS runtime to extend the capabilities of my Rust host via JS scripting?
Btw, I have another question:
Is this crate the least-opinionated-possible layer on top of deno to make it useable inside a Rust host?
In other words, would it make sense for me to use deno directly or always this crate, if my goal is to have an embedded JS runtime to extend the capabilities of my Rust host via JS scripting?
That was the goal of the project, yes
An unopinionated layer on top of deno existing only to simplify integration tasks with minimal overhead
That was the goal of the project, yes
An unopinionated layer on top of deno existing only to simplify integration tasks with minimal overhead
Ok great, just what I had hoped this would be :)
Sorry, I didn't want to derail the topic of this issue..
But yeah, considering this crate could be considered the "canonical" way to use Deno in a Rust host, it definitely would be super nice & ergonomic to have #[wasm-bindgen]-like attributes for marshalling 馃檪
It doesn't have to be #[wasm-bindgen] attributes if that's not possible, but a similar proc-macro attribute would be nice.
This would make marshalling as ergonomic as it could be.
Activity
rscarson commentedon Oct 2, 2024
Can you show me an example of what you mean?
Boscop commentedon Oct 2, 2024
I mean like this:
On Rust items:
https://rustwasm.github.io/wasm-bindgen/reference/attributes/on-rust-exports/constructor.html
On JS items:
https://rustwasm.github.io/wasm-bindgen/reference/attributes/on-js-imports/constructor.html
This would make interop much easier :)
Btw, I have another question:
Is this crate the least-opinionated-possible layer on top of deno to make it useable inside a Rust host?
In other words, would it make sense for me to use deno directly or always this crate, if my goal is to have an embedded JS runtime to extend the capabilities of my Rust host via JS scripting?
rscarson commentedon Oct 2, 2024
That was the goal of the project, yes
An unopinionated layer on top of deno existing only to simplify integration tasks with minimal overhead
Boscop commentedon Oct 2, 2024
Ok great, just what I had hoped this would be :)
Sorry, I didn't want to derail the topic of this issue..
But yeah, considering this crate could be considered the "canonical" way to use Deno in a Rust host, it definitely would be super nice & ergonomic to have
#[wasm-bindgen]-like attributes for marshalling 馃檪rscarson commentedon Nov 4, 2024
Looking to implement this soon
Can I get more examples of how you picture this being used?
Boscop commentedon Jan 10, 2025
Sorry for the late reply..
This page describes exactly what I meant:
On Rust items:
https://rustwasm.github.io/wasm-bindgen/reference/attributes/on-rust-exports/constructor.html
On JS items:
https://rustwasm.github.io/wasm-bindgen/reference/attributes/on-js-imports/constructor.html
It doesn't have to be
#[wasm-bindgen]attributes if that's not possible, but a similar proc-macro attribute would be nice.This would make marshalling as ergonomic as it could be.