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

Possible to override resolver behaviour? #39

Closed
neilalexander opened this issue Oct 30, 2021 · 6 comments
Closed

Possible to override resolver behaviour? #39

neilalexander opened this issue Oct 30, 2021 · 6 comments

Comments

@neilalexander
Copy link

... so that instead of having to call AddGlobal, AddHostFunction etc for everything that we want to inject, that we can instead set callbacks which return function pointers, allowing us to resolve missing functions, missing globals etc?

@codefromthecrypt
Copy link
Contributor

would you mind giving a before and after code snippet for what motivated you to raise the issue? I bet you felt annoyed at a call site you'd love to have better. can you give an example of that?

(ps you can also ignore my feedback, I'm just trying to learn how people are using this, so would appreciate it)

@mathetake
Copy link
Member

Thanks @neilalexander. That kind of API sounds great, but I would like to better understand your usecase and API you have in your mind. Then we could come up with the concrete API before we merge in.

@neilalexander
Copy link
Author

neilalexander commented Nov 8, 2021

I have a project which has a runtime where ideally we'd be able to control which functions and globals are available at runtime based on permissions/capabilities (which can change during execution).

Right now we only have Add functions and no ability to Remove them later, and even if we did have Remove functions, it would turn into a bit of a nightmare tracking which things have been exported and removed from a given VM safely.

I don't have a specific API shape in mind here, but being able to pass in a callback which gets notified when resolving a function or global hasn't already been Added so that we can call custom functions and/or return custom values would be amazing.

I'm not terribly familiar with this codebase but I'll be more than happy to work with you to help design an API shape :-)

@mathetake
Copy link
Member

Hi @neilalexander, I just forgot to reply here.. we are planning to refactor the API in anyway #170, so we will revisit this issue after that. I will keep you posted! Thank you!

@neilalexander
Copy link
Author

Thanks so much for the update, I shall stay tuned!

@codefromthecrypt
Copy link
Contributor

I think this is a relic as the API is wildly different since this was opened. Please open a new issue for any features you need!

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

3 participants