Skip to content

Replace stdout with a finalize function #97

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

Closed
wants to merge 3 commits into from
Closed

Conversation

jeffcharles
Copy link
Contributor

Here's a proposal for how to stop using stdout. This builds on using a singleton context. We remove the finalize function from the API we expose to partner code and create an exported finalize function for the host environment to call which will return a pointer and length to the output buffer. We can exclude calling this finalize function from the fuel and timeout limits.

A tradeoff is we lose performing a final validation of the WriteState in the partners' function. We could move that check to our finalize function or otherwise validate the state of the output vector on the host. That would change how an invalid output surfaces from a function trap to some other form of output error.

@jeffcharles
Copy link
Contributor Author

Superseded by #99

@jeffcharles jeffcharles closed this Jul 2, 2025
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

Successfully merging this pull request may close these issues.

1 participant