Re: [rust-dev] Lightweight failure handling

2014-03-27 Thread Phil Dawes
Hello! @Clark: I must've hit reply instead of reply-all, thanks for re-adding rust-dev. I'm not sure I agree about the fail! thing. I think crashing a task on an unexpected condition is easier to code and to reason about. It forces me to think about recovery and atomicity. Also even if I structure

Re: [rust-dev] Lightweight failure handling

2014-03-27 Thread Daniel Micay
On 27/03/14 10:43 AM, Clark Gaebel wrote: > > That's interesting. You're kinda looking for exception handling in rust! > Unfortunately the language seems pretty principled in its opinion that > failure should be handled at the task boundary exclusively, and this is > a pretty heavyweight opinion.

Re: [rust-dev] Lightweight failure handling

2014-03-27 Thread Matthieu Monrocq
On Thu, Mar 27, 2014 at 3:43 PM, Clark Gaebel wrote: > aside: Your last message didn't get CC'd to rust-dev. I've re-added them, > and hope dearly I haven't committed a social faux pas. > > That's interesting. You're kinda looking for exception handling in rust! > Unfortunately the language seems

Re: [rust-dev] Lightweight failure handling

2014-03-27 Thread Clark Gaebel
aside: Your last message didn't get CC'd to rust-dev. I've re-added them, and hope dearly I haven't committed a social faux pas. That's interesting. You're kinda looking for exception handling in rust! Unfortunately the language seems pretty principled in its opinion that failure should be handled

Re: [rust-dev] Lightweight failure handling

2014-03-26 Thread Clark Gaebel
Sorry, was on my phone. Hopefully some sample code will better illustrate what I'm thinking: loop { let result : Result = task::try(proc() { loop { recv_msg(); // begin latency sensitive part process_msg(); send_msg (); // end latency sensitive part } }); if result

Re: [rust-dev] Lightweight failure handling

2014-03-26 Thread Clark Gaebel
The "main loop" of your latency sensitive application. On Mar 26, 2014 5:56 PM, "Phil Dawes" wrote: > On Wed, Mar 26, 2014 at 9:44 PM, Clark Gaebel wrote: > >> Can't you put that outside your inner loop? >> > > Sorry Clark, you've lost me. Which inner loop? > > ___

Re: [rust-dev] Lightweight failure handling

2014-03-26 Thread Phil Dawes
On Wed, Mar 26, 2014 at 9:44 PM, Clark Gaebel wrote: > Can't you put that outside your inner loop? > Sorry Clark, you've lost me. Which inner loop? ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Lightweight failure handling

2014-03-26 Thread Clark Gaebel
Can't you put that outside your inner loop? On Mar 26, 2014 5:15 PM, "Phil Dawes" wrote: > Hello everyone! > > I'm interested in using rust for latency sensitive applications. What's > the cheapest way to achieve isolation in a native rt environment? > > I'd like to do something like: > > let res

[rust-dev] Lightweight failure handling

2014-03-26 Thread Phil Dawes
Hello everyone! I'm interested in using rust for latency sensitive applications. What's the cheapest way to achieve isolation in a native rt environment? I'd like to do something like: let result: Result = task::try(proc() { ... potentually failing code ... }); but as cheaply as possible an