i know you can use reference counting or clone most everything or add GC in other ways but the entire point is not have to concern yourself with lifetimes at all until it becomes relevant. i'm thinking there's no very good reason why rust can't take the role of c, c++, and python
-
Show this thread
-
Replying to @hyperfekt
the lifetime elision is pretty good now, but stuff like capturing lifetimes in closures/futures is still a syntactic monstrositypic.twitter.com/xRyiGiY1OR
1 reply 0 retweets 1 like -
Replying to @donk_enby
oh i meant the lifetime of data, not lifetime annotations. i think it's very cool that they're not needed as often but that only reduces the amount of effort needed, not the degree of understanding.
2 replies 0 retweets 0 likes -
Replying to @hyperfekt
I think you can get away with not understanding of how the borrow checker works up to a point. And there is a way of nesting your data structures that comes naturally after a while of writing Rust where it's not that much of a pain anymore.
1 reply 0 retweets 1 like -
Replying to @donk_enby
right, the more experience the less of a problem the borrow checker becomes. what would be cool is a language that you can productively use without needing a significant amount of experience.
1 reply 0 retweets 0 likes -
Replying to @hyperfekt
It is a cool language that has a lot of things going for it: no hidden preprocessor macros, not being able to add side effects to the standard library, idioms like "dyn/Box/unwrap/unsafe" that can make bad code immediately stick out in code reviews
1 reply 0 retweets 1 like -
Replying to @donk_enby @hyperfekt
the only difference from other unmanaged languages wrt lifetime of data is that the compiler will refuse incorrect code. whether you solve that error message by adding explicit lifetimes or reference counting is up to the programmer.
1 reply 0 retweets 1 like -
Replying to @donk_enby
right, that's the really cool thing about rust. i'm comparing it to managed languages, however, and asking whether 'gradually unmanaged rust' is viable
1 reply 0 retweets 0 likes -
Replying to @hyperfekt
i think what you're describing can be generalised to passing things by value vs reference which reminds me of RVO
1 reply 0 retweets 1 like -
Replying to @donk_enby
passing things by value only is certainly a way to avoid having to manage a heap, but there's good reason we're not generally doing that i think
1 reply 0 retweets 0 likes
it's an interesting problem, but there are a lot assumptions that need to hold when i.e. freeing an object from a third-party library. probably why Java only does this for primitive types.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Meiklejohnian absolutist. free speech as in free-for-everyone.
mutuals: