,

What is prompting the shift from JavaScript to Rust in the ecosystem?

Posted by






Why is the JavaScript ecosystem switching to Rust?

Why is the JavaScript ecosystem switching to Rust?

JavaScript has been the dominant language for web development for many years. However, recently there has been a growing interest in Rust as an alternative language for building web applications. So, what is driving this shift in the JavaScript ecosystem towards Rust?

Performance and Memory Safety

Rust is a systems programming language that offers a high level of performance and memory safety. This makes it an attractive choice for developers who are building high-performance web applications. Rust’s strict compiler checks and emphasis on memory safety help to prevent common programming errors such as buffer overflows and memory leaks. This can lead to more robust and secure web applications.

Concurrency and Parallelism

Rust’s strong support for concurrency and parallelism makes it well-suited for building high-performance web servers and other server-side applications. With features such as async/await and the lightweight threading model provided by the async-std and tokio libraries, Rust allows developers to easily write efficient and scalable server-side code.

Community Support

The Rust community has been actively promoting the use of Rust for web development. There are a growing number of libraries and frameworks for building web applications in Rust, such as Actix, Rocket, and Warp. The Rust ecosystem also offers tools for frontend development, such as wasm-pack, which allows developers to build web applications using WebAssembly and Rust.

Developer Experience

Rust’s modern and ergonomic syntax, along with its strong type system and powerful tooling, make it a pleasant language to work with. Additionally, the Rust compiler provides helpful error messages and a robust package manager in Cargo. These features contribute to a positive developer experience, which is important for attracting and retaining developers in the JavaScript ecosystem.

Conclusion

Overall, the JavaScript ecosystem is switching to Rust due to its performance, memory safety, support for concurrency and parallelism, community support, and developer experience. As Rust continues to evolve and gain traction in the web development space, it is likely that more developers will consider using Rust as an alternative to JavaScript for building web applications.


0 0 votes
Article Rating
20 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Matt Hudson
11 months ago

Parallelism is great and all but concurrency is where it's at

Arne
11 months ago

I wager that it’s a mix between hype and the 3x speedup you can get (according to the debian benchmarksgame) when you go from JS to Rust. Re-using tooling from FF is naturally also free code …

Nordic Nomad
11 months ago

Expecting a full featured DOM API written in Rust in built with web browser 😊 Hope we can write frontend browser apps with Rust soon 😊

the-islander
11 months ago

Programming languages are a popularity contest. Now is Rust and maybe in the near future will be Zig or other. Rust is not "stable" enough for me in terms is leadership, etc. Things may go wrong very quickly. I want stability, but people continue obsessed with the promise of performance in same cases and just popularity in other cases, such as Python and JavaScript. It's always the same, for decades.

PHILLIP LAM
11 months ago

No we’re not rust is worse than C 😂 what an idiot

Night Fury
11 months ago

this makes me want to learn rust, will start learning rust once I get job so I can freely focus on learning rust
thanks for the video though 🙂

Indramal Wansekara
11 months ago

Turbopack – 1:24 – Bundler

Rspack – 2:13 – Bundler

Rspress – 2:52

Rolldown – 3:18 – Same as rollup

Parcel – 4:42 – Bundler

SWC – 5:56

OXC – 6:10 – Compiler

Lightning CSS – 6:22 – CSS

Tailwind CSS – 7:01

NX – 7:18

Russell Dempsey
11 months ago

this was an excellent intro to rust. thank you

Russell Dempsey
11 months ago

replace rustup, nvm, volta, n, fnm all with asdf-vm. seriously.

TonTj
11 months ago

I like that statement of cargo.

It learnes from npm, yarn, etc. Improve on the good ones and optimize the bad ones.

Chris Godwin
11 months ago

It's note veet, its vyte. It's not Linux, it's leenoox.

Māris Samats
11 months ago

Why is nobody rewriting typescript (tsserver, tsc) itself to rust .. ?

pleggli
11 months ago

JS is also slow due to how it uses memory, not only that it uses a GC it allocates lots of tiny objects all the time instead of having structs or larger entities it can always collect as a complete unit. Programs with lots of allocations are in my experience from debugging and profiling them a lot in production horribly inefficient in how they use memory with large number of objects. It also doesn't help that the still prevailing trend of JS projects using hundreds or some times even thousands of npm dependencies which bloats the whole build and run process a lot.

Marcus Rehn
11 months ago

Honestly, I think the main reason is clout.

杨兴元
11 months ago

I love rspress.

Ad Ici De
11 months ago

I have realized watching channels like this is actually procrastination against learning Rust seriously. no. more.

antarcticmonkeys
11 months ago

It's true that you can write performant code in any language or dogshit code in any language. But it is also true that the language pushes you in one direction or another via the path of least resistance. For example, JS tends to result in code that creates lots of garbage which can be a performance issue on memory constrained devices. Not creating garbage in JS is hard to do, you have to fight against the language to do that.

Necessarius / ネセサリウス
11 months ago

Give me the short answer here please

Cale McCollough
11 months ago

CLI Rust tools make sense, but big fat no to Prisma. I'm not willing to take the cold-boot time hit on serverless. Multi-second cold-boot times are a deal-breaker. Honestly, I'm looking at making a monolith. Today with the new hyper-fast CPUs, it makes more sense for you to target a 128-core server with 2TB RAM and some nVidia H100 GPUs. You should probably just use a dyndns at first and server your website from home until you hit 1000 active month users. Chances are you'll never max it out, but if you do then you can just scale by doubling and you probably will save 4-10 $million. C++ for the win!

Alexi Chepura
11 months ago

Yeah, why are we switching) BTW Thanks for twiggy!