4 ms·
> I tend to think Rust isn't suitable to rewrite JavaScript tooling > any compiled language would do So why not Rust?
by michaelmior 3y ago
> I tend to think Rust isn't suitable to rewrite JavaScript tooling
> any compiled language would do
So why not Rust?
- RamblingCTO 3y agoWrong question. Why rust?
- seanhunter 3y agoBecause the people who actually want to do the work want to do it in rust.
- todotask 3y agoWith both Vite and TailwindCSS v4 written in Tailwind, web development is going to be faster for Astro and other frameworks.
- no_wizard 3y ago>TailwindCSS v4 written in Tailwind Didn't realize it was a self bootstrapping language now. Thats awesome
- RamblingCTO 3y agoThat's a fair answer. Although I still don't agree with rust being particularly fitting for that problem.
- math_dandy 3y agoBecause it’s the only sufficiently mainstream language in the ML family.
- RamblingCTO 3y agoThat's not a reason to use rust in that instance.
- pjmlp 3y agoBecause as mentioned, it isn't a game engine fighting for fitting everything into 16ms into a games console. Similar performance levels can be attained with any AOT compiled managed language, with much better developer productivity. Either one needs to deal with the borrow checker for performance that matters, or if the performance doesn't matter to put .clone() all over the place, then what is the point beyond CV building?!?
- pornel 3y agoOnce you know Rust, the borrow checker is not impacting your productivity. This leaves you with a fast language, with robust and relatively easy multithreading, and a rich ecosystem of high quality libraries. I don’t know any other AOT language that can come close to such productivity. The closest may be golang, but it’s not ideal for parsing.
- FpUser 3y ago>"..relatively easy multithreading" Multithreading is just as "relatively" easy in other compiled languages.
- pornel 3y agoAFAIK no other language has this kind of thread safety in the type system, enforced at compile time. The next best thing is having a particular share-nothing or message-passing paradigm built into the language. Golang for example does not enforce use of synchronization when mutating shared objects from multiple threads, even though it can lead to crashes and vulnerabilities, just like in C and C++. It may be hard to appreciate Rust's fearless concurrency until you see for yourself how it can save you from heisenbugs. You can invoke any function, which could be even a 3d party dependency using more dependencies and touching a million lines of code, and Rust will tell you right away if any of that code has some thread-unsafe behavior (e.g. some method may have internal cache without proper locking). With the safety net of the borrow checker you can use constructs that would have been considered irresponsibly dangerous in other languages, like spawning threads referencing on-stack values of other threads.