Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCO test in Guile-2.1+ implementation #53

Closed
NalaGinrut opened this issue Mar 31, 2015 · 3 comments
Closed

TCO test in Guile-2.1+ implementation #53

NalaGinrut opened this issue Mar 31, 2015 · 3 comments

Comments

@NalaGinrut
Copy link
Contributor

I've encountered a happy trouble when I'm writing step5 in GNU Guile.
I think most of the languages will crash when calling (sum-to 10000) in non-tail-call way. But in Guile-2.1+, it's not true. It's because Guile-2.1+ has auto-grow-stack feature. So if the stack is out, there'll be new allocated stack, depends on your physical memory.
So I can get 50005000 after calling (sum-to 10000), which means rest1 will be set to this number rather than keep nil.
Some implementation, like C could undertake (sum-to 10000), but crash on (sum-to 100000).
But in Guile-2.1+, even (sum-to 1000000) is fine.

Now, how should we fix this properly...?

@NalaGinrut
Copy link
Contributor Author

Alright, seems it's better to exclude step5 test.

@kanaka
Copy link
Owner

kanaka commented Mar 31, 2015

@NalaGinrut yeah, I need a better solution for that. But for now, once you've gotten all other parts of the test to pass, you can just exclude the test in the toplevel Makefile.

@NalaGinrut
Copy link
Contributor Author

@kanaka It's OK now. Guile has a solution to specify the stack size of a closure, named call-with-stack-overflow-handler. I set stack to a very small size to ensure it crash finally. Now I don't have to exclude step5. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants