rustwasm / team

A point of coordination for all things Rust and WebAssembly
MIT License
1.44k stars 59 forks source link

Rust + WebAssembly News #79

Open fitzgen opened 6 years ago

fitzgen commented 6 years ago

Leave comments here with

I'll go through the comments on this issue periodically and turn them into "This Week in Rust+WASM" style posts.

fitzgen commented 6 years ago

https://github.com/bzar/webchat-rs

A doodle to create a mostly-rust client-server web app with a shared data model and binary communication over websocket between a server and WebAssembly client built using wasm-bindgen.

est31 commented 6 years ago

@fitzgen can you, instead of deleting comments, make a new issue if you want to create a new rust+wasm post? Would be great :)

fitzgen commented 6 years ago

@fitzgen can you, instead of deleting comments, make a new issue if you want to create a new rust+wasm post? Would be great :)

Sure thing -- I found it annoying when others made new issues because it meant my browser history was no longer helpful, but if others prefer that it is fine by me.

Will start a new issue after the next newsletter.

fitzgen commented 6 years ago

https://hacks.mozilla.org/2018/04/sneak-peek-at-webassembly-studio/

fitzgen commented 6 years ago

The initial Game of Life tutorial for the book landed: https://rust-lang-nursery.github.io/rust-wasm/game-of-life/introduction.html

fitzgen commented 6 years ago

svelte renamed to twiggy, moved into the rustwasm org, and gained a mascot: https://github.com/rustwasm/twiggy

fitzgen commented 6 years ago

Writing an NES emulator with Rust and WebAssembly: https://medium.com/@bokuweb17/writing-an-nes-emulator-with-rust-and-webassembly-d64de101c49d

fitzgen commented 6 years ago

What will it take to run ggez on wasm? https://wiki.alopex.li/GgezOnWasm

fitzgen commented 6 years ago

twiggy can now analyze bloat from monomorphization of generic functions: https://github.com/rustwasm/twiggy/pull/40

This introduces the twiggy monos subcommand. It finds generic functions that have been monomorphized multiple times, computes the approximate bloat due to monomorphization that would in theory go away if switched to virtual calls, and displays this information.

fitzgen commented 6 years ago

Hello wasm-pack! https://hacks.mozilla.org/2018/04/hello-wasm-pack/

fitzgen commented 6 years ago

Twiggy integrated into wasm studio: https://twitter.com/fitzgen/status/987135974160265216

fitzgen commented 6 years ago

Small WebAssembly Binaries with Rust + Emscripten: https://kripken.github.io/blog/binaryen/2018/04/18/rust-emscripten.html

fitzgen commented 6 years ago

wasm-snip 0.1.1 released: https://crates.io/crates/wasm-snip/0.1.1

fitzgen commented 6 years ago

wee_alloc 0.3.0: https://github.com/rustwasm/wee_alloc/blob/master/CHANGELOG.md#030

fitzgen commented 6 years ago

wasm-snip 0.1.3 https://github.com/fitzgen/wasm-snip

fitzgen commented 6 years ago

Everyone following this repo: please help me collect rust and wasm news by adding news about releases and big PRs and new projects, etc here!

Also, if you have any good first issues, help-wanted issues, easy issues, mentored issues, etc, link them here and we can add them to a "request for contributions" section in the newsletter.

Thanks!

Pauan commented 6 years ago

I added in Futures 0.2 support to stdweb.

For quite a while now it has been possible to easily use Rust Futures and JavaScript Promises (including a mixture of both) in stdweb. That PR updates the existing code to work with the changes in Futures 0.2

fitzgen commented 6 years ago

Request for library: slim web component library

https://github.com/rust-lang-nursery/rust-wasm/issues/162

fitzgen commented 6 years ago

Request for contributions: Design a tree-map visualization for twiggy in WebAssembly Studio

https://github.com/wasdk/WebAssemblyStudio/issues/163

fitzgen commented 6 years ago

Request for library: mpsc channels library built on top of the postMessage API

https://github.com/rust-lang-nursery/rust-wasm/issues/163

fitzgen commented 6 years ago

How does dynamic dispatch (trait objects) work in WebAssembly? http://fitzgeraldnick.com/2018/04/26/how-does-dynamic-dispatch-work-in-wasm.html

ashleygwilliams commented 6 years ago

wasm-pack 0.2.0 is out, https://twitter.com/ag_dubs/status/989699099053232129 (thanks all contributors) release notes: https://github.com/ashleygwilliams/wasm-pack/releases/tag/v0.2.0

ashleygwilliams commented 6 years ago

also lol i just realized based on the insights tab that a german media outlet wrote about wasm-pack: https://www.golem.de/news/wasm-pack-mozilla-packt-rust-software-fuer-npm-1804-133944.html

alexcrichton commented 6 years ago

I've published wbg-rand, a crate which enable default usage of the rand crate on the wasm32-unknown-unknown target (implemented with wasm-bindgen)

fitzgen commented 6 years ago

text adventure / fighting game made with rust and wasm:

https://ldjam.com/events/ludum-dare/41/text-em-up

fitzgen commented 6 years ago

Using LLVM from Rust, to generate WebAssembly

https://medium.com/@jayphelps/using-llvm-from-rust-to-generate-webassembly-93e8c193fdb4

fitzgen commented 6 years ago

Cervus implements a WebAssembly "usermode" on top of the Linux kernel, enabling wasm applications to run directly in ring 0, while still ensuring safety and security.

https://github.com/cervus-v/cervus

ashleygwilliams commented 6 years ago

we accepted 2 participants for the increasing rust's reach program to work with @mgattozzi - we might consider doing profiles of each at some point :)

fitzgen commented 6 years ago

we accepted 2 participants for the increasing rust's reach program to work with @mgattozzi

Awesome! Will they be doing rust+wasm stuff?

mgattozzi commented 6 years ago

@fitzgen yes! They'll be specifically working with me for rust + wasm stuff. I'll be following up with them about what they are interested in with the space later this week and I'll then be working with/mentoring them to land PRs for various things, whether it's documentation, tooling etc.

fitzgen commented 6 years ago

wee_alloc 0.4.0 released:

https://github.com/rustwasm/wee_alloc/blob/master/CHANGELOG.md#040

steveklabnik commented 6 years ago

http has added wasm to their CI https://github.com/hyperium/http/pull/198

steveklabnik commented 6 years ago

Saw this pop up today https://freemasen.github.io/wasm_tutorial/

fitzgen commented 6 years ago

A line by line port of picojs (face detection library in js) to Rust and WebAssembly:

https://www.reddit.com/r/rust/comments/8gg7i1/implement_a_face_detectorpicojs_in_rust_and/

fitzgen commented 6 years ago

WebAssembly Tetris written in Rust

https://github.com/xuu/wasm-tetris

ashleygwilliams commented 6 years ago

wasm-pack is gonna be in the npm weekly this week - will edit with link when it goes out.

fitzgen commented 6 years ago

Twiggy is published on crates.io now: https://crates.io/crates/twiggy

fitzgen commented 6 years ago

A Rust + Wasm + Web Workers fractal renderer

https://www.reddit.com/r/rust/comments/8hdq5r/a_rust_javascript_web_workers_fractal_renderer/

fitzgen commented 6 years ago

Added a twiggy diff subcommand for comparing binaries: https://github.com/rustwasm/twiggy#twiggy-diff

mgattozzi commented 6 years ago

A parser for the WordPress Gutenberg post format: https://github.com/Hywan/gutenberg-parser-rs

When the JS parser was replaced with Rust using wasm it was 50.8x (98%) faster! https://twitter.com/mnt_io/status/994191317923192832

Hywan commented 6 years ago

Actually, the β€œ98%” number is wrong. It's better to keep on the β€œ50.8x faster” :-).

mgattozzi commented 6 years ago

Good to know! :D

CryZe commented 6 years ago

The chrono and time crates now compile successfully with wasm32-unknown-unknown. However querying the actual current time causes them to panic, just like most OS functionality in std. This allows basic usage of both of these crates. https://github.com/rust-lang-deprecated/time/pull/165

CryZe commented 6 years ago

I also made the wasm-to-rust repository public. The wasm-to-rust tool allows you to compile any WebAssembly binary into Rust source code that you can then compile with Rust. https://github.com/CryZe/wasm-to-rust

Here's musl's libm compiled to wasm with clang 7 and then compiled to Rust (warning big): https://gist.github.com/CryZe/3daab58b5b4e2e77c37b03a49645e2e3

Also I've used this tool to compile a Gameboy emulator written in AssemblyScript (WebAssembly subset of TypeScript) to Rust: https://github.com/CryZe/wasmboy-rs

The wasm rust source code looks a lot more reasonable for this one than the libm code: https://github.com/CryZe/wasmboy-rs/blob/master/src/wasm.rs

GIF of the emulator: https://i.imgur.com/vcdrLb2.gif

So far the tool successfully compiled a variety of languages including Brainfuck, C, C++, Kotlin, Go, AssemblyScript to Rust.

Here's sqlite compiled to Rust: https://i.imgur.com/eQfgQCu.png

And Lua: https://i.imgur.com/aS2thEG.png

And some Go code: https://i.imgur.com/qKtPs1C.png

fitzgen commented 6 years ago

@data-pup has been sending solid A++++++ PRs to twiggy, and now they are a part of the twiggy team.

Congratulations @data-pup! :tada: :raised_hands: :confetti_ball:

https://github.com/rustwasm/twiggy/pull/60

sendilkumarn commented 6 years ago

@data-pup πŸ‘ πŸŽ‰

fitzgen commented 6 years ago

Debug panics on wasm32-unknown-unknown easier with the new console_error_panic_hook crate: https://github.com/rustwasm/console_error_panic_hook

fitzgen commented 6 years ago

Snowhash in Rust with WASM: https://joshleeb.com/posts/rust-wasm-snowhash/

mgattozzi commented 6 years ago

Straight from RustFest: https://twitter.com/mgattozzi/status/1000370042331070466

They made a port of wasmi that works with Intel SGX

aidanhs commented 6 years ago

Logobble (https://aidanhs.com/logobble/), the site I'm working on to show interesting things about Rust CI, uses D3.js for visualisations and Rust+WASM for almost everything else (in particular, Yew for dynamic DOM management). The API serves bincode, sharing struct definitions between frontend and backend with a common protocol crate.