What does HackerNews think of yew?

Rust / Wasm framework for building client web apps

Language: Rust

#23 in Hacktoberfest
#9 in Rust
#1 in Laravel
Yew is pretty well loved, but I haven't had a chance to do much beyond toy projects with it.

https://yew.rs/

https://github.com/yewstack/yew

Yes! Backend: https://rocket.rs/ Frontend: https://github.com/yewstack/yew I personally use lit on the frontend to talk to rocket backend.
I would love to see Python in browsers more than Javascript. But since this works through WASM, I'd probably stick with Rust in that case.

If I'm going to be bound by the limitations of how immature WebAssembly is right now, I'd at least use its more mature ecosystem for development, which is Rust. And actually, I recently began doing so in my free time with a framework named Yew[1].

I know that it's unrealistic to expect Python to be a first-class citizen in browsers as JS is, but at some point we'll grow tired of reading "X language is now available for browsers" when it's more like "X can do WASM now".

edit: Anyway, I don't want to come off as under-appreciative of PyScript. I'm sure a lot of people will love it and make it grow a lot. I'd probably give it a try someday too. Props to the developers!

1 : https://github.com/yewstack/yew

I've seen some pretty interesting things like the use of Rust for front end development, like yew[1] and Seed[2].

There aren't many languages that are practical for WASM output. Scripting and managed languages need to ship their interpreters and runtimes with their WASM blobs, and can end up relatively large. JavaScript's interpreter and runtime are baked into every browser already.

That leaves only compiled and unmanaged languages for potentially good WASM targets. As mentioned before, Rust is seeing a lot development in that space. If LLVM can compile it, then Emscripten can output it to WASM.

[1] https://github.com/yewstack/yew

[2] https://github.com/seed-rs/seed

This post links to a PureScript project that is probably the easiest PS framework around.

ReScript + rescript-react is a good alternative. Less safe, waaaay more verbose; but backed by Facebook.

This is quite cute (in TypeScript though): https://github.com/cyclejs/cyclejs

And Yew is super cool, it goes the WASM route (in Rust): https://github.com/yewstack/yew

You can write Rust for the frontend right now. It's pretty neat.

Yew [1] is one of the early Rust frameworks for client side work. It allows for multi-threaded (!) execution and javascript interop.

Not many other languages make sense as you have to pack in the whole runtime, GC, etc. Rust is pretty well positioned for WASM, and it's going to take off soon.

[1] https://github.com/yewstack/yew

There are a few libraries that support this exactly:

https://github.com/stoically/syn-rsx

https://github.com/yewstack/yew

But there are others like Sauron, Maple, and Percy that have their own Elm-like approach which is probably almost just as good.

Yew has an `html!` macro and a very React/Elm like architecture https://github.com/yewstack/yew
> XYZ-to-WASM

There is yew (https://github.com/yewstack/yew) which is a React inspired Rust framework that compiles to WASM.

Share code between client and server using WebAssembly[1]. The Twitch video player is written in C++ via WASM[2]. C# can be "full stack" with Blazor[3]. Rust can be "full stack" with Yew[4]. Similar support exists for other languages including Go[5] and even the TypeScript-syntax AssemblyScript[6].

[1]: https://medium.com/wasm/webassembly-on-the-server-side-c584f... [2]: https://news.ycombinator.com/item?id=16835769 [3]: https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor [4]: https://github.com/yewstack/yew [5]: https://github.com/hexops/vecty [6]: https://www.assemblyscript.org/

I consider myself to traditionally be a backend engineer, though this has more been something I fell into rather than chose.

I admit I feel I share some of your frustrations. In the past I have written production frontends in Angular and experimented with Vue and React. Out of all of them I found React to be the most enjoyable, but even then I still struggled with project setup and found the tooling confusing. I even quite like TS as a language, but I feel it's still quite limited by the fact it transpiles to JS.

Recently, I discovered yew [0]. It is a Rust framework for building frontends using wasm. I really appreciate the robustness that Rust brings such as ownership checks and ADTs. I don't think it's for everyone, but it may be worth looking at if you perhaps find modern frontend development confusing frustrating. I've found it to be quite the breath of fresh air.

If you do decide to have a look I found the examples [1] and getting started guide [2] very informative.

[0] https://github.com/yewstack/yew

[1] https://github.com/yewstack/yew/tree/master/examples

[2] https://yew.rs/docs/en/getting-started/project-setup

> A React competitor that compiles to WASM with promises of perf and space gains will emerge

Yew look like they’re trying to be that alternative.

https://github.com/yewstack/yew

https://github.com/yewstack/yew

Rust web framework generating webassembly apps.

Possible stack could be

yew -> grpc -> rust backend.

Yes! If you are interested in doing front-end in Rust using Wasm, checkout Yew : https://github.com/yewstack/yew The data flow is inspired by React, you’ll feel right at home.
I've been recently looking into some of the new WebAssembly based web frameworks, specifically yew for Rust[0], and I'm having a lot of fun with it. You get a lot of the same compiler guarantee's as Elm, with a familiar syntax if you're already used to writing Rust. It's still rough around the edges though.

[0]https://github.com/yewstack/yew

Rust already has [React-like web framework](https://github.com/yewstack/yew) with a macro for [declarative components](https://github.com/yewstack/yew/blob/ce020d6eb8409b2063cc150...) that compiles to wasm and, last I checked, [runs circles around JS frameworks](https://github.com/DenisKolodin/todomvc-perf-comparison).

I agree that it won't reach the popularity levels of JS due to the learning curve, but on technical side of things future is _now_.

The next thing I can see myself playing with is Yew (https://github.com/yewstack/yew).

We've been moving to Rust in our backend, being able to share some of these lessons (and code) with our front end would be really neat, in addition to being able to take advantage of the new features coming down the pipe for WASM (multithreading!)

Yes, but it can send commands to construct and manipulate DOM. See - https://github.com/yewstack/yew
Both virtual dom and template compilers exist in Rust: Yew for instance uses both to provide a React-like experience: https://github.com/yewstack/yew JSX is easy to implement in Rust due to the fact that macros are first class citizen in Rust.