
Show HN: wasm_val – API to call JavaScript from rust wasm programs - viftodi
https://github.com/viftodi/wasm_val
======
coolspot
How it compares to stdweb
([https://github.com/koute/stdweb](https://github.com/koute/stdweb)) ?

~~~
viftodi
Hello,

The main idea compared to stdweb is to have the ability to call into
javascript dynamically but without having to write actual embedded javascript.

From what I've seed stdweb exposes a js! macro with some features to
conveniently pass around rust values back and forth.

Also from my understanding of it stdweb also features some abstraction layers
of common js APIS based internally on that js! macro.

Ultimately I'd say compared to stdweb, wasm_val aims to provide access to
javascript via an API as compared to writing actual embeded js like stdweb
does or by writing or generating bindings as wasm-bindgen does.

Edit: Also since wasm_val encapsulates js access in an API it provides
additional type-safe guarantees (such as when coercing a JsValue into a rust
type)

Also wasm_val does this dynamically, so you could potentially do some stuff
during runtime that you couldn't in stdweb due to it using code generation as
well.

Hope this answers your question.

