Will Rust Beat JavaScript in 2023?

preview_player
Показать описание
Recorded live on twitch, GET IN

MY MAIN YT CHANNEL: Has well edited engineering videos

Discord
Рекомендации по теме
Комментарии
Автор

If chatgpt writes things for me, Prime reads things for me

cameronraw
Автор

For those who don't know... "steelmanning" is when you address the strongest interpretation of your opponent's argument; that is, the interpretation that is most favorable for your opponent's position. Steelmanning does not mean you're defending their position. Steelmanning is the opposite of a straw-man argument, wherein you attack a position your opponent doesn't actually support. In politics, straw-man arguments are the norm, and steelmanning is rare.

Impatient_Ape
Автор

Dioxus doesn't use signals btw.

it uses the React model, but with compile time macros that remove unnecessary comparisons at runtime

Lena-qgbd
Автор

10:00 These are called "Magical handler functions" and are also used by Axum and Bevy. The technique is done by taking advantage of Rust traits by implementing a trait for Fn with an arbitrary number of arguments, through generics (generated by macros, usually).

They are nice but also comes with some caveats: Error handling (what happens if an extractor fails? e.g. de/serialization), performance with regards to re-computing extractors (as they are independent and cannot share "work already done" between each other) and that the order of how you define extractors in your function arguments can have different performance characteristics (yes, really).

dealloc
Автор

I've seen "HTTP" pronounced as "hot potato"
And "HTTPS" can be pronounced as "hot potatoes"

jokeyrhyme
Автор

Just a heads up that Dioxus does not use signals (it follows VDOM + hooks approach) but is still fast. But its VDOM implementation is much, much better than React/Vue/Preacts approach and the VDOM nodes are flattened templates allocated in a bump allocated arena instead of mapping 1:1 to the DOM.

BosonCollider
Автор

Pointing out that Yew is slow actually helped me wrap my head around these things. React and Yew are slow not NECESSARILY because of their respective languages, but has a lot more to do with their architecture. Virtual DOMS do be expensive

benbowers
Автор

That thing with the type of the srgs changing what you get is also how Be y, the game engine let's you access different things in the world.

Like you can add a "system" that's a function that accepts an arg of type `Query<&Player, With<Class::Mage>>` and now that arg is an iterator over the Players that are Mages.

And you can have an infinite number of them for all kinds of different things. It's amazing to work withm

thekwoka
Автор

I would appreciate to see your tech choices (backend, frontend, databases, devops, etc) for different situations like: what to pick for a MVP, or a small personal project, or a CPU intensive worker, or an IO intensive API, etc

mtifw
Автор

Its not the cost of signals vs not signals, its the cost of a bad/suboptimal implementation. Dioxus is as fast as leptos yet it still uses a vdom.

derschutz
Автор

I should do my personal portfolio page in rust. Would be a good excuse to finally learn it, plus it'd be extra funny because I've somehow become a React frontend dev (fml).

lunafoxfire
Автор

Hi, personally I have not yet explored web and WASM development with Rust (I am not primarily specialized in the web in general), but about what you said at 19:10 I have something to notice:
Rust is not just different from JS in this perspective, but also from C and C++ in that exact same kind of way: Not noticing your bugs, giving you a false impression of simplicity.
And this is actually kind of surprising, since JS versus C and C++ are generally speaking 2 very different kinds of technology, which both bug and crash in different ways (JS type coercions resulting in unexpected outputs, C and C++ bugs with memory and pointers resulting in UB and crashes, segfaults).
So fun fact is that from both the side of JS as well as C and C++ you hear people often come up with that fallacy that development in Rust takes more time, while the opposite is true.

jongeduard
Автор

I've started with JS and I pray that one day Rust will surpass it because you don't want to deal with "undifined" or "[Object object]" all ur life

Quidoute
Автор

I like this article too. Seems a little strange yet to me this mix of Rust with "HTML", remember a lot of old freaking PHP sites. The fact of not using try/catch is awesome, help a lot in logic because many of times we use try/catch of part of our business logic and this is terrible!!

Thanks Prime, cheers my brother!

daltonyon
Автор

As a native android developer i'm curious to try kotlin/wasm with Compose

dleonardo
Автор

I like most takes in the video, I don't agree with the take on TS + Zod though. In rust you will also need a DTO validation library for more than just checking that the type is what you expect. Think of things like min / max / length / regex / comparing two fields etc. This is why Zod and libraries like it for other languages (including rust) are useful, they provide a declarative way to validate data coming into your system that you don't control. If it was just for validating the runtime types it would still be useful but extremely meh.

d.sherman
Автор

I REALLY agree with your comments on "developer experience"

irlshrek
Автор

I would like to see articles like this one pointing also the cons, not just the benefits. I think would give the reader a deeper understanding.

mantovani
Автор

Hey Prime. First of all: Wow, thank you for reacting! I didn't even realise this had gotten so much attention until someone in a discord I'm in actually linked me to this video (and a clip of your initial reaction on-stream). I definitely agree the initial picture was probably not ideal and putting the performance benchmarks first probably ruined the first impressions of the article (as well as maximum clickbait title), but I'm glad that I could get some of your thoughts from reacting to this!

joshmo
Автор

Dioxus is more of a "React in Rust" than Yew i think (that is kind of the purpose of dioxus) but dioxus VDom has a better architecture than Yews, i belief. Returning `impl WhatEver` is also not a trait object its an existential type, you can only return one type out of the function. Trait objects are the ones with "dyn" which are implemented using vtables and dynamic dispatch.

hassan
visit shbcf.ru