become +1 TCO is very important for porting other FP lang to Go. On Monday, February 14, 2011 at 4:25:24 AM UTC+8, Eoghan Sherry wrote: > > On 13 February 2011 08:51, chris dollin <ehog....@googlemail.com > <javascript:>> wrote: > > On 13 February 2011 10:34, Erwin <snes...@gmail.com <javascript:>> > wrote: > >>> > >>> There are no such plans for gc (6g, 5g, 8g). > >>> Personally, I find meaningful stack traces helpful more > >>> often than I find myself using unbounded tail recursions. > >>> I have on other projects used gcc -fno-optimize-sibling-calls > >>> precisely to make stack traces more useful. > >>> > >> Wouldn't a gc -no-optimize mode be a good thing to have once > optimizations > >> get in the way of debugging? > > > > If I'm assuming/relying on tail-call optimisation in my coding, then > > turning it off "for debugging" will likely make my program crash > > demanding more stack frames. > > > > We all have our choices: I'd rather have guaranteed TCO than full > > stack-frames for debugging, but I don't think it's unreasonable for > > someone else to have the opposite preference. > > I found Newsqueak's become statement a nice fit for TCO in an > imperative setting. > > func sum(a, b uint) uint { > if a == 0 { > return b > } > become sum(a-1, b+1) > } > > Eoghan > >
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.