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

Kyo Stack Traces #213

Closed
fwbrasil opened this issue Mar 22, 2024 · 2 comments
Closed

Kyo Stack Traces #213

fwbrasil opened this issue Mar 22, 2024 · 2 comments

Comments

@fwbrasil
Copy link
Collaborator

Early versions of Kyo used to have a mechanism to present better stack traces, similarly to other effect systems, but evolving Kyo while considering how to do that efficiently got difficult so I decided to remove the feature.

At the time, the solution used to use an allocationless macro to generate frame information as constant strings at compile time. It was quite efficient but I felt it was too intrusive. The frame implicit has to be included in virtually all of Kyo's methods since it should come from the user's code.

I think we could go with a solution similar to cats-effect by dynamically inspecting the JVM's stack trace to capture frames. We should use StackWalker to find the origin frame in the user code given that it's much more lightweight. The mechanism would introduce more overhead than the previous static one so I think it'd need to be disabled by default.

@fwbrasil
Copy link
Collaborator Author

I played a bit with StackWalker but the overhead is too high, it wouldn't be viable to use in a production environment. I'm going with a macro similar to ZIO's #413

@fwbrasil
Copy link
Collaborator Author

fixed by #572

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant