Hacker News new | ask | show | jobs
by jxub 2803 days ago
Goddamn, the frequency of Rust-related articles on the front page must be really telling something positive about this language and its community.
2 comments

> must be really telling something positive about this language and its community.

It's because it's the new shiny thing. This basically used to be a ruby on rails post-it board, then C# for a while, then Java when Java 8 Streams were announced, then Go, etc.

I am not saying it's a bad thing -- in fact I can't wait to go through that "write an OS in Rust" blog that was posted here earlier -- but no I don't think it's telling of anything quite yet.

It's not just because it's shiny. Rust happens to (a) be a great fit for the parts of WebAssembly that have been implemented so far (partly because it doesn't need GC), and (b) have done a really good job of building WebAssembly tooling with nicer ergonomics than other languages.
WASM is the new and shiny also. I'm not even sure what to do with it ATM given that the DOM story still hasn't been figured out.
There is a DOM story: host bindings. It just isn't implemented yet.

However, that doesn't mean that you can't use it now. wasm-bindgen is essentially a polyfill for host bindings plus some other little things.

Some resources to check out if you want to learn more:

* Host bindings: https://github.com/WebAssembly/host-bindings/blob/master/pro...

* More info about web-sys (web-sys is like the raw libc for the web): https://rustwasm.github.io/wasm-bindgen/web-sys/index.html

* API documentation for web-sys: https://docs.rs/web-sys/0.3.2/web_sys/

* DOM hello world example: https://rustwasm.github.io/wasm-bindgen/examples/dom.html

* A mini MS Paint style example: https://rustwasm.github.io/wasm-bindgen/examples/paint.html

* An FM synth in WebAudio: https://rustwasm.github.io/wasm-bindgen/examples/web-audio.h...

Even though the DOM story hasn't been figured out, firefox has recently done work to make WASM <-> JS calls performant. So now things like Yew will probably be usable from a performance standpoint[0]. But apart from the DOM, it's good for CPU intensive things[1].

[0] Yew: https://github.com/DenisKolodin/yew [1] Refactoring a CPU intensive JS thing: https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with...

As a child raised on 80s 8-bit computers, and a fan of emulation, I love what WASM does for in-browser emulators. You can run an enormous amount of Apple II, Commodore 64, etc. software on archive.org, all compiled using emscripten.
You forgot Haskell..
And for a year or two it was Node.js.
I regularly hit a search [1] to pick up Rust related stories. Most Rust-related articles don't make the front page and most see no comment activity at all.

Lately the WASM+Rust stories see a lot of activity. Also, some 'I learned Rust and this is what I think about it' type blog posts attract comments. The rest do not. 10 hours ago: "Ask HN: Rust, anyone?" asking who is using Rust in production. No replies.

[1] https://hn.algolia.com/?query=rust&sort=byDate&prefix&page=0...

I completely missed that post even though I'd have definitely replied. Maybe just bad timing.