Comments (6)
i don't think any meaningful interaction with module is possible without sharing the linear memory
Why not? Consider some module that have a function that do some pure computation: e.g. some argument in and result out. This computation requires some memory in form of a stack in linear memory. The stack is transient: that is, stack pointer starts with zero at the start of the computation and ends with zero at the end of the computation.
So this is an example of meaningful interaction with a module that doesn't expose it's memory.
Second example: the module doesn't export a memory but provides an interface in form of exported functions, that user might use to set up some initial information and get results back. (In the end, your module doesn't have to have any memory at all and still might be able to do something useful)
But such kind of interaction might be inconvenient or not efficient or both. So for these kinds of problems we can provide this method default_memory(&self) → Option<MemoryRef>
.
Why I'm calling this an escape hatch? Because it isn't required by the spec and this will certanly mean that some execution engines might not support this kind of interaction. And to not mislead users I want to clearly state that this is an escape hatch
from wasmi.
We can provide something like “default_memory(&self) → Option”
However, i think that we should document this is escape hatch, and the user might not find similar functionality in another execution engine
from wasmi.
why is it escape hatch?
i don't think any meaningful interaction with module is possible without sharing the linear memory, and compilers are not obliged to produce module with exported memory
from wasmi.
on the second thought, i realized that js api indeed provides no way to interact with such internal memory
from wasmi.
i realized that js api indeed provides no way to interact with such internal memory
Good point!
from wasmi.
Closing tilll the spec come up with the official way to do this, at least in JS.
from wasmi.
Related Issues (20)
- Big performance regression between 0.31 and 0.32 HOT 7
- Optimization: Special handling for common shadow stack instruction sequences HOT 1
- Create C bindings for Wasmi
- Simplification: Rewrite `iNN.sub` with immediate to new `iNN.add` variant
- Restore CI benchmarks HOT 1
- Wasmi versions `0.32.0-beta.6` cannot run `ffmpeg.wasm` correctly HOT 20
- Update `wasmi_wasi` WASI implementing dependencies HOT 1
- Optimization: Fuse transitive copies HOT 1
- Add `--verbose` mode to Wasmi CLI HOT 2
- Add support for fully hibernate-able Wasm instances HOT 7
- Handle host function calls the same as other instructions in the Wasmi executor HOT 1
- Make it possible to debug and pretty print Wasmi bytecode
- Add Wasmi execution profiling HOT 1
- The URL in the project description is 404 HOT 1
- Optimize `Linker` setup
- Add customizable `wasmi::Engine` limits
- Reconsider proper fuel charging for lazily compiled functions
- Reduce `wasmi::Engine` memory consumption for storing function artifacts HOT 3
- Try to put the Wasmi engine internals into its own crate
- Wasmi v0.32 stable release preparations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmi.