Re:Grain: A strongly-typed functional programming language f...
by thangngoc89 on Tuesday July 31, 2018 @02:06AM
(#17650899)
Like comparing to Rust compilation to WebAssembly for example?
[ Parent
| on HN ]
Re:Grain: A strongly-typed functional programming language f...
by ForHackernews on Tuesday July 31, 2018 @04:52AM
(#17651583)
Does Rust have any DOM integration?
Re:Grain: A strongly-typed functional programming language f...
by ekidd on Tuesday July 31, 2018 @05:40AM
(#17651782)
Yes. For a while, you've been able to embed JavaScript wrappers using stdweb (https://github.com/koute/stdweb). There are pre-built libraries covering much of the DOM. But you may need to submit PRs if you get heavily into <video> or something else with non-standard APIs.
The shiny new toy is wasm-bindgen (https://github.com/rustwasm/wasm-bindgen), which will soon allow the use of WebIDL (https://heycam.github.io/webidl/) to wrap the entire browser API, if I understand correctly.
In practice, it all seems to work pretty well. But for public-facing sites, you need to watch the number of dependencies you include and keep the *.wasm size down.