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

EnvBase is exported but shouldn't be #1173

Closed
leighmcculloch opened this issue Nov 21, 2023 · 2 comments
Closed

EnvBase is exported but shouldn't be #1173

leighmcculloch opened this issue Nov 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@leighmcculloch
Copy link
Member

Follow on from:

At the moment generated code is directly using the EnvBase and Guest fns, when it should be using SDK functionality. Generated code should make sense to developers and be handle writable. The optimizations that EnvBase offers should also be usable in the SDK.

Today what we have is optimizations used in the generated code that aren't usable outside of it with SDK types.

This issue should involve adding functions to SDK type to surface the EnvBase functionality. Then generated code can be updated to use those SDK functions.

@leighmcculloch leighmcculloch added the bug Something isn't working label Nov 21, 2023
@leighmcculloch leighmcculloch changed the title EnvBase is exported EnvBase is exported but shouldn't be Nov 21, 2023
@graydon
Copy link
Contributor

graydon commented Dec 16, 2024

Fwiw EnvBase is not just there for optimizations: it provides methods that support Rust-language abstractions (Panics and slices) that are higher level than the Env interface, because the Env interface contains some stuff that's based on wasm-semantics (VM traps and linear memory addresses) that do not exist when compiling in Env=Host local-testing mode (the mode without an interposed wasm VM). Like .. wasm linear memory addresses are 32 bit, whereas when running in Env=Host mode on a 64-bit machine, slice pointers are 64 bit. They literally can't pass through an interface phrased in terms of linear memory addresses. Likewise a VM trap that halts the guest isn't a thing when running in Env=Host mode; the effect is emulated with Rust panics but they are fundamentally different machinery.

Not that any of this is necessarily "stuff to show to users", but like .. EnvBase is there for a reason and fully erasing or removing it isn't likely to be possible if we keep Env=Host mode.

@leighmcculloch
Copy link
Member Author

I don't think this is blocking anything in particular at this moment, so I think we can close it.

@leighmcculloch leighmcculloch closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@graydon @leighmcculloch and others