Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Function calls are not stack frames (ezrakilty.net)
34 points by edw519 on Nov 5, 2009 | hide | past | favorite | 2 comments


"Maybe we want to know the call structure at runtime; in that case, we should capture that as debugging information, or as a reflection feature of the runtime system, but not as a core language design. Let the language implementation use the stack as efficiently as possible!"

Thank you. I don't know what the fear of implementing tail-calls without stack frames is, but I've heard it a bunch of times & the argument often seems to be - "we need stack traces". If that is essential, implement it as debug info & let the language spec be fast & powerful.


I don't understand why those people that clamor for stack traces don't also clamor for full histories of their programs' execution.

It's as if we do the loop:

    for (x=5; ; x--)
      y += 1/x;
And when it throws an exception for dividing by zero, you should want a full "backtrace", with a "frame" for each iteration of the loop.

That's no different than demanding a stack trace for:

    (define (loop x)
      (set! y (+ y (/ 1 x))
      (loop (- x 1))
    (loop 5)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: