On Thu, Jun 6, 2013 at 11:59 AM, Gábor Lehel <illiss...@gmail.com> wrote: > > Am I way off base with this? An embarrassing misconception? To summarize my > train of thought > > * Catchable exceptions can be implemented > * But we don't want to, because it would force everyone to think about > exception safety > * That could however be avoided with appropriate restrictions > * Rust's type system already gives us the tools to impose those > restrictions, as evidenced by them being imposed on `try()` > * Therefore it should be possible to have much of the benefit of catchable > exceptions, without their drawbacks
The cost of spawning a task with try over a theoretical optimized exception handling scheme will only be the small stack segment it needs to allocate (likely cached). The scheduler will switch to it immediately, and if it doesn't do I/O there won't be a switch back until it's done. I think someone will need to demonstrate a performance issue with the completed scheduler before providing a special case in the language will seem like a serious suggestion. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev