Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-11-15 Thread Brian Anderson
On 10/10/2012 11:48 AM, Brian Anderson wrote: On 10/10/2012 04:16 AM, Henri Sivonen wrote: On Fri, Oct 5, 2012 at 10:03 PM, Brian Anderson bander...@mozilla.com wrote: Even break and continue by label would be useful without fall-through in alt. Thanks, Henri. I've posted this information

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-10-10 Thread Henri Sivonen
On Fri, Oct 5, 2012 at 10:03 PM, Brian Anderson bander...@mozilla.com wrote: Even break and continue by label would be useful without fall-through in alt. Thanks, Henri. I've posted this information to our bugtracker: https://github.com/mozilla/rust/issues/2216 Thanks. So does this mean I

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-16 Thread Graydon Hoare
On 12-04-15 06:23 PM, Joe Groff wrote: On Sun, Apr 15, 2012 at 6:19 PM, Patrick Walton pwal...@mozilla.com wrote: Only if LLVM's optimizer is smart enough to turn that code into a goto-based state machine. I'm not sure if it is. (Of course, if it's not, that's possibly fixable...) IIRC

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-16 Thread Patrick Walton
On 4/16/12 11:46 AM, Graydon Hoare wrote: They're already present (were from the beginning) but they broke when we shifted from rustboot (hand-rolled code generator) to rustc (LLVM). It turns out that you have to adopt a somewhat pessimistic ABI in all cases if your functions are to be

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-16 Thread Graydon Hoare
On 12-04-16 11:49 AM, Patrick Walton wrote: On 4/16/12 11:46 AM, Graydon Hoare wrote: They're already present (were from the beginning) but they broke when we shifted from rustboot (hand-rolled code generator) to rustc (LLVM). It turns out that you have to adopt a somewhat pessimistic ABI in

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-16 Thread Stefan Plantikow
Hi, Am Montag, 16. April 2012 um 20:54 schrieb Graydon Hoare: On 12-04-16 11:49 AM, Patrick Walton wrote: On 4/16/12 11:46 AM, Graydon Hoare wrote: They're already present (were from the beginning) but they broke when we shifted from rustboot (hand-rolled code generator) to rustc

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-16 Thread Graydon Hoare
On 12-04-16 04:07 PM, Stefan Plantikow wrote: Some algorithms just yearn for being written in a recursive style. Or state-machine style, yeah. IMO the use case for tail calls is more state machines than recursion. But both can be rewritten without. I think it's just a style issue; I don't

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-15 Thread Brian Anderson
On 04/10/2012 05:53 AM, Henri Sivonen wrote: It appears that Rust does not to have labeled loops with break and continue by label the way Java has. Also, it appears that alt does not have fall-through the way switch in C has. Are break and continue by label and/or fall-through in alt supported

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-15 Thread Patrick Walton
On 04/15/2012 06:17 PM, Sebastian Sylvan wrote: Could tail calls work? I.e. each label would equal a separate function (any state would have to be passed through), and then you'd just keep tail-calling from state to state. Without really knowing exactly what kind of code you're trying to

Re: [rust-dev] Fall-through in alt, breakcontinue by label

2012-04-15 Thread Joe Groff
On Sun, Apr 15, 2012 at 6:19 PM, Patrick Walton pwal...@mozilla.com wrote: Only if LLVM's optimizer is smart enough to turn that code into a goto-based state machine. I'm not sure if it is. (Of course, if it's not, that's possibly fixable...) IIRC there was talk of adding explicit tail calls

[rust-dev] Fall-through in alt, breakcontinue by label

2012-04-10 Thread Henri Sivonen
It appears that Rust does not to have labeled loops with break and continue by label the way Java has. Also, it appears that alt does not have fall-through the way switch in C has. Are break and continue by label and/or fall-through in alt supported in some non-obvious and unadvertised way? If