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

Allowing "non-eligible" tail calls #24

Open
thysultan opened this issue Feb 6, 2019 · 3 comments
Open

Allowing "non-eligible" tail calls #24

thysultan opened this issue Feb 6, 2019 · 3 comments

Comments

@thysultan
Copy link

thysultan commented Feb 6, 2019

Not throwing in non-tail call eligible tail calls surfaces an opportunity to support the collapsing of stack traces.

This is related to:

Another potential benefit of STC is that we know what the developer is intending and can give warnings or errors for, for example, claiming they're about to do a tail call and not putting the call in tail position.

Instead of throwing/warning. There's often a use case for library authors to attempt to remove as much as possible of library specific "call-traces" from the stack trace, especially in production. For example Firefox has pursed something akin to this in their dev-tools experience.

This may be a problem for developers who use this information to debug their programs

This may also be an opportunity to provide framework and library authors the ability to explicitly opt-into or opt-out of displaying library specific stack traces that often plagues consoles in both Node.js and the Browser.

@ljharb
Copy link
Member

ljharb commented Feb 6, 2019

That’d need to be an entirely separate proposal, and since stacks aren’t in the language yet pending https://github.com/tc39/proposal-error-stacks, it might be a bit too soon for it.

@thysultan
Copy link
Author

It is however predicated on "ptc syntax" at least considering this in its design if we are to avoid yet another syntax grammar provisioned for the stack traces case; assuming that is a desirable goal to begin with.

@ljharb
Copy link
Member

ljharb commented Feb 6, 2019

I don’t see how; the use case for opting out of stack frames applies to all functions, with or without tail call usage.

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