Open-Source Discovery: Yew.rs

huhn
Open Marketplace Applications
4 min readNov 9, 2020

--

Build nearly browser native applications with WebAssembly (WASM) and Rust with Yew.

What is Yew.rs?

Yew is a modern Rust framework for creating multi-threaded front-end web apps with WebAssembly.

This description includes many buzzwords, which we will discover below.

Front-end

Describes the part of an app that people can see and interact with.

Framework

A Framework provides a standard way to build applications. Its purpose is to facilitate the development of software applications.

Front-end Frameworks

Known Front-end Frameworks for Javascript are Angular, Vue.js, or React.js.

Web Application

This kind of application runs in a Web browser, instead of the Operating System like usual applications. That means you can use the app by just browsing to a website without installation. Today's Web Applications are often also Progressive Web Apps (PWA), which can be added to the Home screen and used offline. For users is kind of the same experience as a native application, but without downloading them from an app store.

WebAssembly (WASM)

Open standard that defines a portable binary-code format for executable programs.

  • WASM is supported by most browsers
  • You can compile from many programming languages to WASM
  • Almost as performant as browser native web applications

Benchmarks

“WASM is about 30% faster than JavaScript*”

Performance benchmarks for various TodoMVC implementations

https://github.com/DenisKolodin/todomvc-perf-comparison

You can see, Yew.rs is the fastest Frontend Framework on this list.
Here are some links to test WASM vs Javascript in your browser.

Yew Alternatives

There are a few Frontend Frameworks written in Rust, which can be compared with Yew. We currently just tested Yew, because its winning in each of the KPI’s below. Feel free to contact us, if you tested another Framework.

https://github.com/flosse/rust-web-framework-comparison

Yew Ecosystem

The Yew Ecosystem has many tooling from the community for developers. The best source to discover the Ecosystem is the Awesome Yew list.

😎 Awesome Yew

👼 Tools and extensions

📚 Yew Components Libs

Core Developer Interview

We’ve interviewed Starry, on of the core contributors of Yew.rs. Questions are bold.

Please describe your project.

Yew is a Rust / WASM framework for building client web apps.

How did the idea come about?

After Rust supported the WebAssembly target, there was finally an easy way to write web applications in a non-JavaScript language. The original creator of Yew, Denis Kolodin, seized the opportunity and created a React / Elm hybrid framework with Rust.

What target audience is the project directed to?

Rust developers who want to bootstrap a web application quickly in a language that they are familiar with.

Does the project have concrete goals? If yes, which? Roadmap?

The goals are dictated by the community, the project is not run by any large organization. I would say the main goal is to create a viable alternative to writing web applications in JavaScript that is performant and easy to use.

Who is the project responsible and who belongs to the team?

Current maintainers are Justin Starry and Simon Berger. But the community extends beyond that because there are many complimentary libraries managed by other devs.

What knowledge and experience do you have?

Justin has many years of experience in web development but started learning Rust while contributing to the Yew project.

What motivated you to move the project forward?

Engaging with the community is really fun and it’s really exciting to be part of a growing popular project whose potential has not yet been reached.

What motivates you to continue the project?

Working closely with the friendly members of the community to solve fun and challenging problems. It’s rewarding to watch over the community to ensure it stays welcoming and encouraging to everyone, including people new to Rust and web development

Can the community help you? If yes how?

Yes, no project owner knows everything. The community suggests the best ideas and often write code better than I would. We all learn from each other :)

Very thanks for the interview and wish you all the best for the future. We’re happy to test Yew for your Client Applications!

Conclusion

  1. Similarity to known JS frameworks
  2. Not yet ready for Production
  3. Tooling in early development (Linters, Component Libraries, Styles Code Highlighting, etc.)
  4. Small but Growing Community
  5. Clearly the Favourite Rust WASM candidate

Resources and Links

--

--