News for hackers. Stuff that matters.
Re:Python 3.11 is faster than 3.8 by Thaxll on Wednesday October 26, 2022 @03:05PM (#33347932)
"Rust the least-painful language"

" I’ve been using Rust for a couple of years now and I still don’t really understand lifetimes"

Seems like a major pain point.

Re:Python 3.11 is faster than 3.8 by Shish2k on Wednesday October 26, 2022 @03:14PM (#33348034)
It would be if I ran into it regularly -- but after using the language for a variety of professional and personal projects for a couple of years, this is the only time I’ve actually needed to manually-specify lifetimes since the compiler normally figures it out for me :)
Re:Python 3.11 is faster than 3.8 by pkolaczk on Wednesday October 26, 2022 @03:26PM (#33348169)
As long as you don't get too crazy with references in structures or async code, lifetimes are not going to chase you.
Re:Python 3.11 is faster than 3.8 by galangalalgol on Wednesday October 26, 2022 @03:46PM (#33348421)
Generics too right?
Re:Python 3.11 is faster than 3.8 by pdimitar on Wednesday October 26, 2022 @09:23PM (#33351844)
I know people say that about everything but Rust generics are very readable and do make sense after you understand what problem are they solving.

They do look intimidating to start with, admittedly, and I'll concede that's a negative point for Rust. But it does get better if you practice for a bit.

Re:Python 3.11 is faster than 3.8 by galangalalgol on Wednesday October 26, 2022 @10:53PM (#33352497)
No I just meant using generics seems to require explicit lifetimes decently often. I don't understand why.
Re:Python 3.11 is faster than 3.8 by pdimitar on Wednesday October 26, 2022 @10:58PM (#33352543)
Not sure that's the case btw. I have noticed it with some libraries but I've used and crated a fair amount of generics without having to annotate stuff with lifetimes.

Lifetimes are necessary when you want to explicitly say "variable X will live just as long as variable Y", or sometimes it's more complex (i.e. you have to specify 2 or more separate lifetimes and then return something that pertains to only one of them) but it's still fairly predictable if you keep it all in your head while coding.

Don't get me wrong I still hate it but it's not as terrible as many people make it out to be. It's hard to get into but also very logical and graspable.

Re:Python 3.11 is faster than 3.8 by robocat on Wednesday October 26, 2022 @03:15PM (#33348049)
They are saying rust is painful. Just that they find the other languages even more painful.
Re:Python 3.11 is faster than 3.8 by davisoneee on Wednesday October 26, 2022 @03:26PM (#33348171)
Except that they don't really say rust was painful....just that there was one specific moment / aspect that they found tricky.
Re:Python 3.11 is faster than 3.8 by Ar-Curunir on Wednesday October 26, 2022 @03:49PM (#33348462)
The reason it's not a pain would be explained by the rest of the sentence which you omitted: "but thankfully 99% of the time I can avoid them"