Rust Is the Future of JavaScript Infrastructure

Rust Is The Future of JavaScript Infrastructure – Lee Robinson.
Why is Rust being used to replace parts of the JavaScript web ecosystem like minification (Terser), transpilation (Babel), formatting (Prettier), bundling (webpack), linting (ESLint), and more?

Read in full here:

This thread was posted by one of our members via one of our news source trackers.

2 Likes

Corresponding tweet for this thread:

Share link for this tweet.

2 Likes

Articles like this make me want to learn Rust!

Tho bits like this make me think twice :lol:

Why Not Rust?

Rust has a steep learning curve. It’s a lower level of abstraction than what most web developers are used to.

Rust makes you think about dimensions of your code that matter tremendously for systems programming. It makes you think about how memory is shared or copied. It makes you think about real but unlikely corner cases and make sure that they’re handled. It helps you write code that’s incredibly efficient in every possible way. – Tom MacWright (Source)

Further, Rust’s usage in the web community is still niche. It hasn’t reached critical adoption. Even though learning Rust for JavaScript tooling will be a barrier to entry, interestingly developers would rather have a faster tool that’s harder to contribute to. Fast software wins.

1 Like

Honestly the Rust ecosystem is way overcautious (which I think is a good trait). Like the Rust community mostly comes from haskell and C++ and compared to each of those Rust is like baby training wheels, lol, but they give those warnings because its what they are used to be giving with C++ and Haskell because, honestly, a lot of them think that programmers for more ‘simple’ languages like javascript and java and such things have a high learning curve to it, when they really don’t (especially with modern javascript and java and such things). Rust already does what are best practices in almost every language but it does them faster, safer, and with compiler errors to lead you on the right track (which are utterly outstanding compared to basically any language, yes that includes elixir).

I could give you a crash course from the perspective of X whatever language you know over IRC or Discord or so if you want, work looks like it will be slow today (considering over half the people are gone, lol).

But from my personal perspective, the reason why Rust might have a higher learning curve is not because its harder to learn (honestly I think it’s much easier to learn than ‘most’ languages), it just doesn’t let you write bad code, so what most languages would have accepted but would have just been outright wrong, Rust will not accept, it forces you to write good code, and that’s a skill you can take back to any other language.

EDIT: Remember the first line in the article after all, there’s a reason for this!

Rust is a fast, reliable, and memory-efficient programming language. It’s been voted the most loved programming language six years in a row (survey).

6 years! And Rust doesn’t even have a huge SO presence because they have such a large community already on their own forums, their discord server, their zulip server, and reddit, which makes it even more astounding.

3 Likes

Ah nice! I will definitely take you up on it one day!! :003:

For me Rust is most interesting for WASM, hopefully by the time I am ready to get into it things might have moved on a bit by then.

My current plan is:

  • Programming Erlang
  • Programming Phoenix
  • Create a small-ish app in Phoenix
  • See whether I need to read more Elixir/Erlang books or whether it’s time to check out Rust or Swift

Yew looks interesting - at some point it might be worth having a ‘State of WASM 2021/22’ thread :smiley:

While WASM isn’t the perfect solution yet, it can help developers create extremely fast web experiences. The Rust team is committed to a high-quality and cutting-edge WASM implementation. For developers, this means you could have the performance advantages of Rust (vs. Go) while still compiling for the web (using WASM).

Some early libraries and frameworks in this space:

3 Likes

alot of great things happening lately…

“So Many Snacks, So Little Time”

2 Likes

Maybe add Nitrogen to your list, since you know … Erlang :nerd_face:

2 Likes

It’s on my list Gary :lol:

2 Likes

The Nitrogen book on LeanPub has been entertaining. The authors have a good sense of humor. :nerd_face: :+1:

2 Likes