Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-11 Thread Sam Hughes
I've hit this problems a few times, and I immediately thumbs-upped that issue report. To correct @Ben, I suggest the purest reasoning for an error being displayed is "The process completed, and did not succeed". In your case, @Ben, yeah, it was killed while waiting on something, but the normal

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-11 Thread ben...@gmail.com
> Depending on implementation, infinite recursion is not guaranteed to blow > the stack for the program given. The function call is in tail position, so > a tail-call optimization (TCO) pass would be able to rewrite the program > into an infinite loop by reusing the existing stack frame for ea

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-11 Thread Jesper Louis Andersen
On Wed, Apr 6, 2022 at 3:18 AM ben...@gmail.com wrote: > Normally the Go Playground gives errors when a runtime panic or other > error occurs, including "timeout running program" for programs that run too > long. I'm wondering why the Playground doesn't show a stack overflow error > (or any error

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread ben...@gmail.com
Oh wait, looks like it's public: https://github.com/golang/playground On Wednesday, April 6, 2022 at 3:32:11 PM UTC+12 ben...@gmail.com wrote: > Sure, report an issue against the playground. I honestly have no idea >> how difficult this would be to fix. >> > > Thanks, done: https://github.com/g

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread ben...@gmail.com
> Sure, report an issue against the playground. I honestly have no idea > how difficult this would be to fix. > Thanks, done: https://github.com/golang/go/issues/52176 The source for the Playground is private, correct? -Ben -- You received this message because you are subscribed to the Goo

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread Ian Lance Taylor
On Tue, Apr 5, 2022 at 6:50 PM ben...@gmail.com wrote: > >> The playground isn't intended to be an exact replica of running a >> program on a real machine. If the program uses too many resources it >> will simply be stopped. > > > Both fair enough. But surely the runner can distinguish when the pr

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread Kurtis Rader
On Tue, Apr 5, 2022 at 6:18 PM ben...@gmail.com wrote: > Normally the Go Playground gives errors when a runtime panic or other > error occurs, including "timeout running program" for programs that run too > long. I'm wondering why the Playground doesn't show a stack overflow error > (or any error

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread ben...@gmail.com
> The playground isn't intended to be an exact replica of running a > program on a real machine. If the program uses too many resources it > will simply be stopped. > Both fair enough. But surely the runner can distinguish when the program ran successfully to completion versus when it was st

Re: [go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread Ian Lance Taylor
On Tue, Apr 5, 2022 at 6:18 PM ben...@gmail.com wrote: > > Normally the Go Playground gives errors when a runtime panic or other error > occurs, including "timeout running program" for programs that run too long. > I'm wondering why the Playground doesn't show a stack overflow error (or any > e

[go-nuts] Why does infinitely-recursing code not give stack overflow in Playground?

2022-04-05 Thread ben...@gmail.com
Normally the Go Playground gives errors when a runtime panic or other error occurs, including "timeout running program" for programs that run too long. I'm wondering why the Playground doesn't show a stack overflow error (or any error) for this infinitely-recursing program? https://go.dev/play/