News for hackers. Stuff that matters.
Re:Moving from TypeScript to Rust / WebAssembly by blub on Thursday July 09, 2020 @02:10AM (#23777411)
It didn't figure them out at all, the programmer had to figure them out the hard way and then code them in so that the compiler understands them.

GC is figuring out things mostly correctly and the programmer can focus on other things, at least until they hit a performance problem :)

Re:Moving from TypeScript to Rust / WebAssembly by Lorkki on Thursday July 09, 2020 @04:54AM (#23778246)
For the most part, lifetime is inferred from scope, so there isn't anything special to figure out; objects live exactly for as long as you can see and use them. This also includes such things as lock handles, or references to refcounted objects.
Re:Moving from TypeScript to Rust / WebAssembly by jashmatthews on Thursday July 09, 2020 @06:17AM (#23778628)
Only in the most trivial cases. Tons of real Rust uses copying or RC/ARC or even unsafe to avoid dealing with complex lifetimes because it's... complex.
Re:Moving from TypeScript to Rust / WebAssembly by Lorkki on Thursday July 09, 2020 @07:31AM (#23779021)
Copying, refcounting and locking work within the exact same semantics. They're among the most typical tools that are used to transmit or share data, so I'm not sure why it should be strange to see them used in most real programs?