3 ms·
> bunch of us who use JS at work and are specifically looking for the exact opposite in our hobby projects I use Rust at work, and JS only in hobby projects :)
by pornel 6y ago
> bunch of us who use JS at work and are specifically looking for the exact opposite in our hobby projects
I use Rust at work, and JS only in hobby projects :)
There is something "opposite" about these languages, but I think both coexist because there's very little overlap in their use-cases. You use Rust where JS can't be used (multicore, high-performance, or low-level native code), and use JS where Rust would be overkill (small webby things).
- lostcolony 6y agoJust picking a nit, but it's not multi-core that JS can't be used; Node has some solutions for leveraging all your cores (multiple node processes, basically. PM2 and its ilk). It's specifically CPU bound problems, where the benefits of JS' concurrency model can't shine.
- brundolf 6y agoPicking a further nit: the key difference is that most other languages can share memory directly between threads, whereas JS can only pass messages between threads (which requires copying data, and usually serialization/deserialization)
- pornel 6y agoWorkers have "transferable" objects that in theory avoid copies, but still there's a world of difference between coarse-grained message-passing style, and fine-grained data parallelism you can get from something like rayon. JS "can" do a lot of things if you know how, and cleverly implement and optimize the code, but it's a Turing Tarpit. You wouldn't implement a video codec in JS. You could, but it's not the best language for it.
- vallas 6y agoI wonder if Unity-like game dev projects could use Rust as a low-level language and JS for all scripting?