News for hackers. Stuff that matters.
Re:Moving from TypeScript to Rust / WebAssembly by blub on Thursday July 09, 2020 @02:20AM (#23777475)
What's puzzling is why a language designed for memory safety and low-level control and performance is even being considered for web development where they had the former all along and they generally don't care about the latter. Or if they do they use Java, Go or throw a couple dozen more servers at the problem.
Re:Moving from TypeScript to Rust / WebAssembly by ragnese on Thursday July 09, 2020 @07:46AM (#23779130)
It's because it also has expressiveness features that Java and Go don't.

* Better handling of "null"-ness

* Sum types

* Stricter/different error-handling

* Move semantics, which can actually be nice for some APIs outside of any performance considerations

Kotlin checks a couple of these boxes, but then is also GC'd, so also gets rid of a lot of "noise" that would be in the equivalent Rust code.

For typical backend junk, I'd be Kotlin first, but I'd definitely consider Rust if performance (non-IO) was a concern.

Re:Moving from TypeScript to Rust / WebAssembly by entha_saava on Thursday July 09, 2020 @04:03AM (#23777977)
With all the "Rust is as productive as X" and "If your data structure/logic won't work in rust, it was bad design" bullshit the silent majority of us are accustomed to see on HN..
Re:Moving from TypeScript to Rust / WebAssembly by imtringued on Thursday July 09, 2020 @05:38AM (#23778463)
With Java you only need to throw more RAM at the server. The performance is perfectly acceptable compared to something like Python or Ruby. You can always squeeze out more performance with Rust but the primary benefit is the lack of a GC.
Re:Moving from TypeScript to Rust / WebAssembly by sweeneyrod on Thursday July 09, 2020 @06:24AM (#23778665)
I don't understand your last sentence. What benefits does lack of a GC have other than more performance?
Re:Moving from TypeScript to Rust / WebAssembly by zozbot234 on Thursday July 09, 2020 @05:47AM (#23778508)
A bit offtopic for HN, but that's a really nice username. (Just looking at that, I can definitely see how you'd find those things puzzling!)