Yeah. It's valuable not just for memory management, but because it's a mechanism that everybody agrees is allowed to have visibility across abstraction boundaries. Otherwise, every module needs to coordinate resource hand-off, complicating interfaces.
Conversation
What benefits could come from agreeing on other cross-cutting mechanisms (that aren't necessarily about memory)? Erlang gets tremendous value out of agreeing on a concurrency & error-handling approach, for example.
1
1
4
thats the conceit of a VM like the CLR. you have an agreed upon GC, type system, error handling, (large) standard library, C-interop, etc. it's great! but its a VM. Rust is the only VM-less platform of standardized cross-cutting mechanisms i can think of.
1
3
Yeah, this is what's finally bringing me over to Rust. I don't want to write code by Rust's constraints, but maybe I can think of it like Rust's memory constraints being "these are the module boundary constraints" and use cheatz to violate the constraints in-module.
1
1
9
Incidentally, I am still waiting for a language that has a way of agreeing how exceptional conditions are handled across module boundaries. I don't believe exception handling is good enough
2
3
What I want is a standard idiom where actual errors like "invalid parameters" and exceptional-but-expected conditions like "file not found" are handled within the same mechanism, yet the mechanism understands one is lighter-weight and must be easier to do casually than the other.
1
3
Sometimes tries to convince me this is what common lisp "conditions" are but i still haven't gotten around to learning how this works.
2
3
Rust used to actually have conditions for stuff like IO errors, but having three different ways of doing error handling in one language was a bit much (results, panics, conditions). could probably elaborate…
2
2
Perhaps if the only way of handling errors was conditions then folks would have learned it properly and liked them, but at the time they were always this 'annoying backwater that you had to deal with when doing IO'.
1
Here's a broken reddit link to a now dead page: reddit.com/r/rust/comment - would need to do more digging to find it - possibly in the git repo.
1
cc. - interesting thread here - know of any good ways to get to ancient Rust documentation?
i see... sorta wish that error-by-return-code had been the one removed instead of conditions *_*
1
I'm not so sure - I guess I'm more of a fan of monadic error handling. Rust's lack of extensible variants can make managing all your error types abit annoying, I'll admit. The failure crate makes this nicer, but then you're effectively shelling out to dynamically typed errors.
1
2
Show replies
Off the top of my head the way back machine to see an old site as it was. Depends on how far back. If it's code based comments it might be in the git repo. You want what's from the Reddit thread? I'm like in transit right now so digging things up will be difficult till later
1
Show replies
Found it! (just had to go from the top-level, I think the files got renamed but the links didn't get updated) doc.rust-lang.org/0.9/guide-cond
1





