Re: [julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Cedric St-Jean
On Sat, May 7, 2016 at 2:19 PM, Yichao Yu wrote: > On Sat, May 7, 2016 at 1:21 PM, Cedric St-Jean > wrote: > > Thank you for the detailed explanation! > > > > Would it make sense to run the catch blocks/finalizers before unwinding > the > > stack? I.e. each `try` pushes its catch/finally block a

Re: [julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Yichao Yu
On Sat, May 7, 2016 at 1:21 PM, Cedric St-Jean wrote: > Thank you for the detailed explanation! > > Would it make sense to run the catch blocks/finalizers before unwinding the > stack? I.e. each `try` pushes its catch/finally block as a "closure" onto a > separate stack, to be run when an exceptio

Re: [julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Cedric St-Jean
Thank you for the detailed explanation! Would it make sense to run the catch blocks/finalizers before unwinding the stack? I.e. each `try` pushes its catch/finally block as a "closure" onto a separate stack, to be run when an exception occurs, then the stack is only unwound once regular control

Re: [julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Yichao Yu
On Sat, May 7, 2016 at 8:46 AM, Cedric St-Jean wrote: >> mostly due to various technical reason In arbitrary order, the ones I can think of now. 1. We collect backtrace There are many cases where we don't actually need this info, but we need better code analysis to be able to figure that ou

Re: [julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Cedric St-Jean
> mostly due to various technical reason Could you please go into those? I'd like to understand why unwinding the stack is costlier than returning from a function. On Saturday, May 7, 2016 at 8:38:03 AM UTC-4, Yichao Yu wrote: > > On Sat, May 7, 2016 at 6:58 AM, Ben Ward > wrote: > > Hi, > >

Re: [julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Yichao Yu
On Sat, May 7, 2016 at 6:58 AM, Ben Ward wrote: > Hi, > > I have a question which may be laughable to CS people (be gentle, I'm a > Biologist), but we know from guidelines that Julia performs best, when a > method always returns the same type of value. > So the Julia type inference knows - ok, use

[julia-users] Perhaps stupid question: Method type stability and throws

2016-05-07 Thread Ben Ward
Hi, I have a question which may be laughable to CS people (be gentle, I'm a Biologist), but we know from guidelines that Julia performs best, when a method always returns the same type of value. So the Julia type inference knows - ok, use this method with an Int, it will always return a bool sa