4 ms·
I love JS (pretty unpopular opinion here on HN) and I love Rust also and I'm not convinced using Rust on front-end tasks would have any benefits. Yet, I strongl
by stymaar 10y ago
I love JS (pretty unpopular opinion here on HN) and I love Rust also and I'm not convinced using Rust on front-end tasks would have any benefits. Yet, I strongly disagree with you on this point :
> Rust is a low level systems programming language, it's very suboptimal for high level front end code from productivity standpoint
Rust's type system is wonderful, and it's a real productivity boost. Fortunately people at Facebook developed an equivalent for JavaScript [1] because living without it would be really hard for me now.
Furthermore, Rust offers a lot of syntactic sugar that makes it feel like a really high level language (compared to C, Go or even JavaScript pre-ES6 for instance).
>it's advantages (mem safety with 0 cost abstractions) don't really matter in frontend
It's indeed one of Rust selling point (especially for people coming from a C background) but it's not the only one. My favorite being the data-race free parallelism. I don't know the current status of multi threading in wasm, but being able to take advantage of all the cores of mobile devices could really help front-end frameworks.
[1]: http://flowtype.org http://flowtype.org, it's not inspired by Rust but inspired by OCaml, which also inspired Rust.
- rubber_duck 10y ago>Rust's type system is wonderful, and it's a real productivity boost. Rust type system is verbose compared to higher level languages and it lacks a lot of the things that make higher level languages productive. It just focuses on low level code - which is good - but you wouldn't use it in place of C#, you would use it instead of C++, and you don't want to write GUI code in C++ either (even Qt uses JS for the frontend) >My favorite being the data-race free parallelism. Also mostly irrelevant in front end since you're dealing with single threaded event loops and doing parallel work that talks to UI thread is easy. Stuff that needs to do work in parallel can be written in Rust and talk to front end via FFI or RPC.
- cesarb 10y ago> even Qt uses JS for the frontend Only if you use QtQuick. The traditional QWidget API is C++ all the way.