Comments (10)
I completed porting to WasmTime, please see https://github.com/christophwille/csharp-opa-wasm/tree/master/WasmTimeTest. It is much more readable thanks to DynamicObject (never cared to nicely hide the necessary magic in WasmerSharp). I think I'll port the NuGet that I create over to WasmTime too.
from wasmtime-dotnet.
CC @peterhuene
from wasmtime-dotnet.
ok, I traced the min exception to here:
and yes, the wat shows (import "env" "memory" (memory $env.memory 2)) with a minimum of 2. This fixes the exception I reported. Just for clarification: providing more min memory than min requested is really a problem?
from wasmtime-dotnet.
Hi @christophwille. I think these restrictions in the .NET API should be relaxed so that the host doesn't have to specify exactly the same values.
By the way, the constructor to Memory
expresses the minimum and maximums in page units, so this should do it:
EnvMemory = new Memory(2); // min page size = 2
from wasmtime-dotnet.
It also appears that the doc comment for the Memory
constructor is missing param
text too.
from wasmtime-dotnet.
Yes, thanks, the min page I figured out by reading the source code of WasmTime.Net.
from wasmtime-dotnet.
@christophwille that's awesome!
If there are other improvements you'd like to see regarding the Wasmtime .NET API, we're definitely open to suggestions and contributions!
from wasmtime-dotnet.
After that little memory snag, the only minor issue was the null-terminated strings; however, I already had the code for WasmerSharp, so this translated nicely to Memory.Span. I don't know how common those null-terminated strings are, but maybe having a ReadNullTerminatedString baked into Memory might be useful (but only if OPA isn't the only one out there doing it this way).
from wasmtime-dotnet.
ExternMemory.ReadNullTerminatedString
was added after 0.12.0 (I think? I'd have to check) as well and would be included in the next release.
from wasmtime-dotnet.
This should now be fixed in 0.15.0 since it uses the new internal Wasmtime linker rather than implementing linker in the C# API. For future issues, we've created a new repro at https://github.com/bytecodealliance/wasmtime-dotnet.
from wasmtime-dotnet.
Related Issues (20)
- Undefined behavior when callback exception handler throws another exception
- Question: Generic Store HOT 8
- `Function` instance passed to a callback (as `funcref`) cannot be called outside of the callback HOT 4
- Better Caller HOT 7
- NuGet package README should not include the HTML
- GC.KeepAlive HOT 1
- Wasmtime.WasmtimeException: Unable to create a callback with a return type of type 'System.UInt32' (and also with Uint64) HOT 3
- Filesystem interception HOT 1
- `wasmtime_func_call_unchecked` signature has changed
- Loading a wasm file built with emscripten results in unknown import: `wasi_snapshot_preview1::fd_close` has not been defined' HOT 2
- How to pass a function to WebAssembly? HOT 4
- Use latest Windows CI images when issue is resolved.
- unknown import: `xxxmodule::xxxFunc` has not been defined HOT 1
- Does the document need to be updated? HOT 1
- Calling an exported function causes a panic HOT 3
- Small tweak in src\Wasmtime.csproj can remove dependency on "unzip" HOT 1
- Wasi interface stdout fail
- WASM that runs in wasmtime will not run in the library HOT 6
- instance.getfunction or instance.getaction does not find function with &[u8] argument
- AOT Compatibility HOT 1
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 wasmtime-dotnet.