Svelte vs... Yew? Modern Frontend Frameworks

  Рет қаралды 61,447

Code to the Moon

Code to the Moon

Күн бұрын

Пікірлер: 148
@irlshrek
@irlshrek 2 жыл бұрын
Svelte is so awesome. Like the developer experience is just.. Fun
@codetothemoon
@codetothemoon 2 жыл бұрын
totally agree - I was blown away by it
@chang112x
@chang112x 2 жыл бұрын
so true
@gorilla-san
@gorilla-san 9 ай бұрын
Until you try to dynamically add a svg icon as a string and not an image
@irlshrek
@irlshrek 9 ай бұрын
@@gorilla-san why is that a problem?
@notanenglishperson9865
@notanenglishperson9865 2 жыл бұрын
Like that people started embrace "fire style" in programming-related videos
@codetothemoon
@codetothemoon 2 жыл бұрын
Thanks, yeah it's a fun style!
@real1cytv
@real1cytv 2 жыл бұрын
Really good video, I've been writing yew the past week and I've noticed a couple of rust idiosyncrasies and missing features that really get in the way of fast development. Callbacks (from js) for example are an absolute nightmare with intransparent lifetimes, especially in yew which does not have a good way to create them. I've noticed myself rather falling back to writing javascript and binding that back into yew instead of trying to write more rust... Stacktraces are a nightmare as well, just today I've been trying to debug an oom error that has something like 800 lines of stacktrace, which is not fun. The ecosystem is also quite small still, and even though that will definitely change in the future, for now you're reinventing the wheel a lot of the time and missing many of the creature comforts that normally come with web development (such as autoformatting, etc). When it works, it's a blast to write though. It really feels like what React was intended to be but in rust. Though for me the shortcomings are just too big to do something substantial for now, so I'm gonna use svelte :)
@jwickerszh
@jwickerszh 2 жыл бұрын
One part you did not touch is the size, IIRC WASM can still be bloated, especially compared to Svelte which is .. svelte. Also not mentioned is SSR, not sure how Yew works there ...
@codetothemoon
@codetothemoon 2 жыл бұрын
Re: package size, great point! I should have mentioned this. Re: SSR, this omission was a bit more deliberate as Yew's SSR is coming in the next release, so I couldn't really say Yew doesn't have it, but I couldn't really dive into it because the feature is still in flux, so yeah just awkward timing. Probably will do a dedicated video for Yew SSR when it is in a stable release.
@jwickerszh
@jwickerszh 2 жыл бұрын
@@codetothemoon That would be cool, fullstack Rust is coming it seems.
@erics2133
@erics2133 2 жыл бұрын
Agreed. One of WASM's biggest drawbacks is the fact that WASM is so primitive that almost any programming language is going to need at least some runtime even for the most basic operations. This means that Svelte would have a download size advantage until the app gets complicated enough that that runtime isn't a significant amount of the download.
@CodingWithLewis
@CodingWithLewis 2 жыл бұрын
Yew is for sure different, but I would really love to give it a try
@boi64pr60
@boi64pr60 2 жыл бұрын
Omg Lewis
@codetothemoon
@codetothemoon 2 жыл бұрын
It's definitely worth checking out IMO, hard to imagine this approach not becoming more popular as the WASM issues are sorted out
@veritas7010
@veritas7010 Жыл бұрын
Dude, ty for your content. Actually concise and to the point
@codetothemoon
@codetothemoon Жыл бұрын
Thanks for watching, glad you found value in it!
@JoeldaSilvaVicenteFilho
@JoeldaSilvaVicenteFilho 2 жыл бұрын
Thanks for the videos!! It would be interesting to see a video showcasing all the frontend frameworks for Rust, we don't need to even see code in the video, just a list of the state of development, some pros and cons, or something like that, just so we know what is available out there, all in one place.
@codetothemoon
@codetothemoon 2 жыл бұрын
Great idea Joel! I've added to the video idea list. Fwiw I've tried a few and nothing seems to be as mature as Yew quite yet, but they all have different approaches and some are very promising.
2 жыл бұрын
It's theoretically possible to add this to Svelte:
@codetothemoon
@codetothemoon 2 жыл бұрын
that would be amazing - doesn't it have to be a language that compiles to JS though? since Svelte compiles to vanilla JS
2 жыл бұрын
@@codetothemoon Rust can compile to WASM, they could use WASM directly, or compile the WASM to JS. As I said, theoretically possible, not sure if it's a good idea, but I'd use it.
@justinoneill2837
@justinoneill2837 2 жыл бұрын
Rich and the team have talked about rewriting the Svelte compiler in Rust. Just talk though. Not sure if that would enable Rust to be easier adapted into Svelte apps or not. lang="rust" would be pretty rad
@AmxCsifier
@AmxCsifier 2 жыл бұрын
You can create a preprocessor for that
@sharansharma19
@sharansharma19 2 жыл бұрын
Thanks alot your diagram for explaining yew was very clear 😂👍
@codetothemoon
@codetothemoon 2 жыл бұрын
Haha happy to help! Routing in Yew isn't *bad* necessarily, it's just that SvelteKit routing is just so incredibly simple so it creates a bit of a contrast...
@xavhow
@xavhow 2 жыл бұрын
Yeah, its really js vs wasm atm. For now, wasm is pretty niche. Wait until wasm matures then switch to pure wasm web app is probably best option.
@codetothemoon
@codetothemoon 2 жыл бұрын
Agree WASM isn't quite mature enough to recommend on a widespread basis, but it's definitely something to keep an eye on...
@henrycgs
@henrycgs Жыл бұрын
I think... a mix of the two is possible. call me crazy, but I think it's very much possible to create a rust powered framework as easy to use as svelte. I think macros are powerful enough to do stuff like the directory based routing, and even creating components with a single macro. maybe one day we will be writing svelte! {}.
@codetothemoon
@codetothemoon Жыл бұрын
I agree, and having something like svelte! {} would be incredible! Hopefully it's just a matter of time.
@brentsteyn6671
@brentsteyn6671 2 жыл бұрын
I don't think it is to difficult to use rust -> wasm with svelte.
@codetothemoon
@codetothemoon 2 жыл бұрын
Yeah, probably not a huge factor. I definitely have a preference for isomorphic apps.
@PhilKingstonByron
@PhilKingstonByron Жыл бұрын
Maybe time to review Leptos (kinda like SolidJS, but in Rust). A comparison on that would be interesting...
@codetothemoon
@codetothemoon Жыл бұрын
I actually just made a video called "Build A full stack chatbot in Rust" that uses Leptos. I personally found the developer experience to be much better than it was when I was building with Yew...
@someghosts
@someghosts Жыл бұрын
Some nooby questions: 1. Any options for rust that have a better developer experience than Yew? 2. Are most of the ‘developer experience shortcomings’ (comparative to svelte at least) down to design decisions of the frame work or just the kind of things you have to do when working with a systems language like rust?
@tylerfat
@tylerfat Жыл бұрын
1. Most people like sycamore better, and there is a new framework called leptos(but it requires nightly), and they are both similar to SolidJS. 2. I don't see any reason why we couldn't have a project similar to svelte, but using rust instead of js/ts, we just don't currently. React is the most popular, so people wanting to switch to switch to rust were more likely to have react experience, and want to build something similar. I'd imagine as svelte gains popularity, we will eventually have a framework that is similar. Rust as a language isn't really that restrictive, it just has a high learning curve.
@someghosts
@someghosts Жыл бұрын
@@tylerfat thanks!
@jantoko
@jantoko Жыл бұрын
Svelte is really good, but I always play for hard mode, love Yew period.
@codetothemoon
@codetothemoon Жыл бұрын
Hah, it is hard mode indeed. Leptos is also looking really interesting, I'm looking forward to checking it out...
@jantoko
@jantoko Жыл бұрын
@@codetothemoon Looking forward for the potential framework on Rust. 😍😍
@Maartz
@Maartz 2 жыл бұрын
I’d like to emphasize the one that can avoid runtime issue 😉
@Maartz
@Maartz 2 жыл бұрын
And as usual, short yet concise video! Thanks.
@codetothemoon
@codetothemoon 2 жыл бұрын
Seeing 'undefined is not an object' in the console does get old very quickly :)
@codetothemoon
@codetothemoon 2 жыл бұрын
thanks William!
@soushi8885
@soushi8885 Жыл бұрын
@@codetothemoon Now, let's brave the Rust compiler :p
@markus-sagen
@markus-sagen 2 жыл бұрын
Just what I’ve been looking for
@codetothemoon
@codetothemoon 2 жыл бұрын
nice thanks for watching!
@sovenok-hacker
@sovenok-hacker 10 ай бұрын
Yew will be faster than JS in doing something non-DOM-related, like doing computations on client-side
@codetothemoon
@codetothemoon 10 ай бұрын
exactly! this video was made prior to my discovery of Dioxus and Leptos, both of which appear to be faster than Yew for DOM manipulation as well.
@neerosity
@neerosity Жыл бұрын
leptos vs yew vs dioxus ?
@eduardabramovich1216
@eduardabramovich1216 Жыл бұрын
Have you seen the Grain programming language? Heard a bit and it seems to be the first lang focused on WASM, it compiles to WASM by default, I wonder how it would be to create a frontend with it.
@codetothemoon
@codetothemoon Жыл бұрын
took a look, looks interesting. I like the "WebAssembly as the primary compilation target" approach
@AlbertCloete
@AlbertCloete 2 жыл бұрын
Maybe Yew can just do away with the DOM and do everything in Canvas.
@dealloc
@dealloc 2 жыл бұрын
Good bye accessibility, SEO and battery life.
@codetothemoon
@codetothemoon 2 жыл бұрын
Hah! I don't think Yew will be going that route, but I believe there are other frameworks that take this approach
@everythingisfine9988
@everythingisfine9988 2 жыл бұрын
Svelte 👑
@codetothemoon
@codetothemoon 2 жыл бұрын
Agree, though WASM may be an usurper...
@samuelfischer3764
@samuelfischer3764 Жыл бұрын
svelte with wasm rust would be amazing
@codetothemoon
@codetothemoon Жыл бұрын
I agree!
@robertreimann1846
@robertreimann1846 2 жыл бұрын
...and we'll see YEW on the next one clever
@codetothemoon
@codetothemoon 2 жыл бұрын
🙃 I'm here all week...
@pookiepats
@pookiepats 8 күн бұрын
Svelte can't get out of its own way. Svelte = Vue Lite (to upgrade just use Vue).
@codetothemoon
@codetothemoon 8 күн бұрын
interesting take! I've always assumed it was the other way around, but I don't have enough Vue experience to confirm that. What do you love about Vue that you can't do in svelte?
@303pix
@303pix Жыл бұрын
i know it's a old video but what about svelte (or solidjs or qwik) vs leptos?
@codetothemoon
@codetothemoon Жыл бұрын
IMO Leptos is a quantum leap forward from Yew in terms of developer experience. I think Svelte still feels a bit cleaner, more productive and likely what I'd still recommend for someone building a business critical webapp right now. But Leptos brings the Rust frontend / full stack ecosystem much, much closer, and as the ecosystem matures a bit more it's conceivable that the tables will turn
@azzamsya
@azzamsya Жыл бұрын
@@codetothemoon Thank you so much for taking time to response. Coming here just to ask your very personal opinion about Svelte Vs Leptos too. I am torn between them. Thanks for the answer! 🏅
@303pix
@303pix Жыл бұрын
@@codetothemoon thanks 🤩
@dcascato
@dcascato 2 жыл бұрын
Hello there, just loved the content. But I think that out of fun or curiosity, and maybe the dislikes on Javascript, it seems overkill to use a language like Rust, for frontend apps 😝
@codetothemoon
@codetothemoon 2 жыл бұрын
Thanks Denis! I think many share your sentiment, and there are definitely many use cases that won't currently benefit much from such an approach.
@ariseyhun2085
@ariseyhun2085 2 жыл бұрын
Though, imagine a large app such as facebook messenger, or binance being written completely in Rust. The type system would make your app infinitely better to maintain over time than JS I think.
@jaiv
@jaiv 2 жыл бұрын
@@ariseyhun2085 thats why they use flow or typescript. the types are less strong but still good for big javascript projects
@kamalkamals
@kamalkamals 2 жыл бұрын
choose the winner so choose actix :)
@codetothemoon
@codetothemoon 2 жыл бұрын
Actix is backend!
@CT-cx8yi
@CT-cx8yi 2 жыл бұрын
Checkout Perseus next!
@codetothemoon
@codetothemoon 2 жыл бұрын
nice, I was actually thinking Perseus might be next!
@Lavender_1618
@Lavender_1618 2 жыл бұрын
Yew just looked like heiroglyphics to me. Svelte looked like Vanilla JS and HTML. Ill stick to svelte.
@codetothemoon
@codetothemoon 2 жыл бұрын
I wouldn't try to talk you out of it, Svelte is fantastic!
@aNotoriousPhD
@aNotoriousPhD 2 жыл бұрын
that might just be a matter of not knowing rust syntax, if you become familiar with that it’s not that complicated
@magicjtv
@magicjtv Жыл бұрын
For rust frameworks I liked seed. Unfortunately it hasn’t been updated in 3 years.
@codetothemoon
@codetothemoon Жыл бұрын
yeah I remember finding its approach compelling, but when I saw that it didn't appear to be maintained any longer I had to rule it out. Luckily these days we have Leptos :) If I were to make this video again now it'd be Leptos vs Svelte
@dimiutube
@dimiutube 4 ай бұрын
Haha, this is more comparing bottles to glasses. How would the result be now, 2 years later 🤔
@codetothemoon
@codetothemoon 4 ай бұрын
good question - I'd definitely not be using Yew as the Rust representative anymore. But I'd probably still be using Svelte as the JS representative. On the Rust side I'd probably compare it to Leptos, which has a few of the things I like the most about SvelteKit - namely isomorphic functions
@Surenderkumar-zf6rc
@Surenderkumar-zf6rc 2 жыл бұрын
It's just awesome
@codetothemoon
@codetothemoon 2 жыл бұрын
Svelte, Yew, the video, or the entire channel? 🙃
@alexvass
@alexvass 2 жыл бұрын
Thanks
@codetothemoon
@codetothemoon 2 жыл бұрын
Wow thank you so much Alex! Much appreciated!!
@echobucket
@echobucket Жыл бұрын
This is cool, but what a weird thing to compare these two...They are so different.
@codetothemoon
@codetothemoon Жыл бұрын
Thanks! The weirdness was deliberate 😎
@cebuanoninoy
@cebuanoninoy Жыл бұрын
Why not use Rust for backend and Svelte for frontend?
@codetothemoon
@codetothemoon Жыл бұрын
Definately a viable approach! But using a common language on the frontend and backend does have its perks.
@SpaghettiRealm
@SpaghettiRealm 2 жыл бұрын
See yew in the next video 😂
@codetothemoon
@codetothemoon 2 жыл бұрын
😂 Stay tuned for more lame puns!
@spectr__
@spectr__ 2 жыл бұрын
Why is Yew manipulating the DOM in the first place?
@codetothemoon
@codetothemoon 2 жыл бұрын
Same reason React and Svelte do - it computes what the page is supposed to look like, then manipulates the DOM as a means of rendering that page to the user
@ocean3323
@ocean3323 2 жыл бұрын
Imagine vue and nuxt, but rust version
@codetothemoon
@codetothemoon 2 жыл бұрын
that would be amazing as well!
@gerasimenkoandrei1062
@gerasimenkoandrei1062 Жыл бұрын
When i try to read Yew documentation i want to cut my eyes off. Any frontend framework will be better than Yew.
@codetothemoon
@codetothemoon Жыл бұрын
It does seem to no longer be the golden child of frontend Rust anymore. I don't think I would start another project with it - Leptos seems much more appealing now. I've also heard great things about Dioxus but haven't tried it myself
@2002budokan
@2002budokan Ай бұрын
3:36 Type Checker 🤣🤣🤣
@codetothemoon
@codetothemoon 27 күн бұрын
🤣
@kokizzu
@kokizzu 2 жыл бұрын
productivity died when i touch Rust XD hail Svelte and Go
@codetothemoon
@codetothemoon 2 жыл бұрын
hah, i imagine you're not alone in this sentiment!
@verified_tinker1818
@verified_tinker1818 2 жыл бұрын
It takes getting used to. Most languages you get better at over time. They let you start with easy projects and go from there. Rust has a learning cliff. Even a simple to-do app might take a beginner to the language forever to create, and it's a slow crawl to basic proficiency. But once you're there, the curve tapers to a more manageable level and you can begin using the language normally. There'll still be lots to learn, but it won't (usually) feel like bashing your head against a wall.
@ten0re0re
@ten0re0re 2 жыл бұрын
Depends on what you understand as productivity. Churning out carefree code surely feels productive, hunting the 'undefined is not a function' errors when you are supposed to be done - not so much. JS frameworks are great for projects that never go out of prototype phase, but in production I'd very much rather support something written in Rust.
@lnv-lnv
@lnv-lnv 2 жыл бұрын
Yew❤❤❤
@codetothemoon
@codetothemoon 2 жыл бұрын
Building a frontend using Rust is liberating!
@anasouardini
@anasouardini 2 жыл бұрын
I think it should've been JS vs Wasm.
@codetothemoon
@codetothemoon 2 жыл бұрын
Oh that's a video I'd love to do, I'm afraid it might not be a fair fight quite yet though 🙃
@anasouardini
@anasouardini 2 жыл бұрын
@@codetothemoon I meant the same thing. I think svelt vs yew is like wasm vs js
@codetothemoon
@codetothemoon 2 жыл бұрын
@@anasouardini yeah that's definitely one facet of it!
@josecaira1112
@josecaira1112 2 жыл бұрын
works gj
@codetothemoon
@codetothemoon 2 жыл бұрын
Nice, thanks Jose!
@altairbueno5637
@altairbueno5637 2 жыл бұрын
Yew is like react
@codetothemoon
@codetothemoon 2 жыл бұрын
Exactly like React!
@neuzen
@neuzen Жыл бұрын
No one should use JS from the day WASM appears.
@codetothemoon
@codetothemoon Жыл бұрын
WASM is here! but there are some downsides to work through....
@xtraszone
@xtraszone 2 жыл бұрын
Svelte is love😍 Yew is euuu🤢
@codetothemoon
@codetothemoon 2 жыл бұрын
Hard to argue against using Svelte!
@NikPiermafrost
@NikPiermafrost 2 жыл бұрын
Blazor Wasm exists thoe
@codetothemoon
@codetothemoon 2 жыл бұрын
Yeah I keep hearing amazing things about it, can't wait to give it a try!
@CheshireSwift
@CheshireSwift Жыл бұрын
I've got a lot of respect for Svelte, but convention over configuration always feels like a mistake. There's a reason the industry moved away from Rails.
@VixieTSQ
@VixieTSQ 2 жыл бұрын
comparing sveltekit the metaframework to yew the not metaframework doesn't make much sense
@codetothemoon
@codetothemoon 2 жыл бұрын
I agree it's not really a "fair" fight, the idea here was to get a feel for the entire developer experience to expect from each ecosystem. The Rust ecosystem definitely is in dire need of a SvelteKit equivalent!
@VixieTSQ
@VixieTSQ 2 жыл бұрын
@@codetothemoon But I think it's misleading... A lot of people I'm reading in the comments I think assumed it was supposed to be a fair fight. It led to a lot people needlessly bashing yew which makes me quite sad :(
@balqaasem
@balqaasem Жыл бұрын
I hate debugging in JS. Rust is king
@codetothemoon
@codetothemoon Жыл бұрын
🦀👑
@gustavojoaquin_arch
@gustavojoaquin_arch Жыл бұрын
Yew>>>>>>sveltezzz
@codetothemoon
@codetothemoon Жыл бұрын
Nice! The landscape has changed a bit since I made this video, have you tried Leptos or Dioxus at all?
@ambuj.k
@ambuj.k Жыл бұрын
Both are good as long it's not angular.
@imxd9698
@imxd9698 2 жыл бұрын
lmfao we are not going to be writing web apps in Rust
@codetothemoon
@codetothemoon 2 жыл бұрын
no need to!
@balqaasem
@balqaasem Жыл бұрын
Yew is amazing, this seems like a Svelte propaganda 😂
@codetothemoon
@codetothemoon Жыл бұрын
hah! since this video I've fallen in love with Leptos. the server functions are absolutely incredible
@tyunpeters3170
@tyunpeters3170 Жыл бұрын
“Yew is” is bad grammar
@codetothemoon
@codetothemoon Жыл бұрын
hah! touche!
@sky_kryst
@sky_kryst 2 жыл бұрын
Solidjs vs astro
@protocode_227
@protocode_227 2 жыл бұрын
Astro is a meta framework, you'd use Solid inside Astro. No idea what you would want to compare 🤔
@codetothemoon
@codetothemoon 2 жыл бұрын
Nice, putting Astro on the to do list...
@Wreighn
@Wreighn 2 жыл бұрын
Rust is just so damn ugly.
@protocode_227
@protocode_227 2 жыл бұрын
When it's for the dumBEST Logo, then it's svelte, correct 😄 that uninspired @&#$
@codetothemoon
@codetothemoon 2 жыл бұрын
LoL, so much ambiguity here. I was really just bitter that Yew doesn't seem to have a vector version of their logo, so when I want to show it relatively big in a 4k video it gets really pixelated
Rust Server-Side Rendering With Yew SNEAK PEEK
5:49
Code to the Moon
Рет қаралды 11 М.
Build A Rust Frontend (Really FAST Web Apps with Yew)
7:28
Code to the Moon
Рет қаралды 226 М.
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 202 МЛН
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 40 МЛН
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 25 МЛН
WebAssembly On The Server??? Why?
13:42
Code to the Moon
Рет қаралды 38 М.
Rust full stack web frameworks have a bright future
8:02
Code to the Moon
Рет қаралды 83 М.
A Legendary Web Framework is Reborn... In Rust
9:49
Code to the Moon
Рет қаралды 94 М.
The Truth about Rust/WebAssembly Performance
29:47
Greg Johnston
Рет қаралды 184 М.
Larger Scale Software Development (and a Big Trap)
17:17
Code to the Moon
Рет қаралды 92 М.
Full Stack Rust Webapp + Docker Image Build
12:39
Code to the Moon
Рет қаралды 53 М.
Rust Powered Database SurrealDB (It's Pretty Ambitious)
11:28
Code to the Moon
Рет қаралды 110 М.
Why Functional Programming Languages are Different
3:10
Rust at speed - building a fast concurrent database
52:54
Jon Gjengset
Рет қаралды 213 М.
Let's Build a RUST WebAssembly Frontend App With Yew
35:32
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 202 МЛН