Skip to content

Latest commit

 

History

History
105 lines (65 loc) · 2.3 KB

presentation.md

File metadata and controls

105 lines (65 loc) · 2.3 KB

Goodbye JavaScript 👋 Hello Rust: Exploring front-end development with yew.rs

Introduction

Attention graber + greeting

SLIDO!!!

Have you ever built a web application?

Are you familiar with JavaScript?

How familiar are you with Rust?

Mention a fron-end framework! (Word-cloud)

Is it a good idea to use Rust for your web UI?

  • No

Is it a good idea to use JavaScript for your web backend?

  • Also no

Front-end frameworks in Rust

  • Yew
  • Seed
  • ...

Topic

This presentation is about exploring front-end development in Rust...

Questions I would like to answer in this presentation are

  • What are the benefits of building your frontend in Rust?
  • When does it make sense to choose Rust for your frontend?

About me

...Engineering Physics + Machine Learning ...Tobii, Norna, Klarna, Validio

Read the Rust book 2017, implemented AoC in Rust. Various side projects etc...

Body

Background

Let's talk a bit about my background in web development.

  • Django (travel blog)
  • Flask + React (Data cleaning tool)
  • FastAPI + Elm UI (Data annotation tool)
  • Rocket + Elm UI (Wedding web page)
  • Actix Web + Yew.rs (Nutrition tracking tool, in progress...)

What stack would I use today?

  • Real conventional SPA application: Rust backend + TypeScript frontend (Validio)
  • Real content-drivent application: Rust backend + tera templates (SSR)
  • Small project: Full-stack Rust (Full-stack JS used to be king here)

Important properties for smaller projects

  • Ergonomics
  • Hackability
  • Single language, avoid repeating type definitions & logic
  • Rich ecosystem of libraries

Let's start exploring!

Quick primer on WASM & Rust

...

Choosing Yew.rs?

  • Seed seemed more similar to Elm, whereas Yew gave a more "hackable" and react-like impression.
  • Seed used cargo generate, Yew has a clean start.

Minimal Yew.rs app

This is what you need to get started with Yew:

Code placeholder

Full-stack JS vs. full-stack Rust

  • Rust is not the perfect fit for front-end development.

What's worse, having Rust in your front-end or JS in your backend?

Conclusion

Questions

Conclusion/summary

Is it a good idea to use Rust for your web UI today?

  • No

Will Rust become a viable language for web UIs in the future?

  • No

But is it at least fun to write front-end Rust?

  • Also no, but let's do it anyway ;)