alexcrichton opened PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
peterhuene submitted PR Review.
peterhuene created PR Review Comment:
Nit: I realize this is example code (although the amount of example code that ends up in use is always surprising), but it's a bit strange, at least to me, for a function called
print_error
to exit. Perhapsexit_with_error
or something similar?
peterhuene created PR Review Comment:
This (and the similar changes above) is the source of the .NET CI failures since it's now the inverse of what the .NET code is expecting (i.e. return value of 0 is now success rather than failure).
As I'm now moving the .NET code to
wasmtime-dotnet
, so we just merge this in with failing CI and fix it there or do you want to get this CI green and I'll port the fix to the other repo?
peterhuene submitted PR Review.
peterhuene created PR Review Comment:
This appears unreachable due to the exit in
print_error
.
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
Indeed! Mind double-checking my C# to confirm that what's there is reasonable?
(it's somewhat intentionally not fully fleshed out in every spot since I figured you'll want to tweak APIs further as well)
peterhuene created PR Review Comment:
I'll make a note that we should probably be throwing here rather than return
bool
, but this is fine for now.
peterhuene submitted PR Review.
peterhuene submitted PR Review.
peterhuene created PR Review Comment:
Is this necessary? From the C API trap messages are null terminated (for some reason...), but for our API we don't have to do that I assume.
peterhuene submitted PR Review.
alexcrichton submitted PR Review.
alexcrichton created PR Review Comment:
That's what I get for blindly copy/pasting this from the
TrapException
code
alexcrichton updated PR #1467 from enhanced-c-api
to master
:
This commit adds new
wasmtime_*
symbols to the C API, many of which
mirror the existing counterparts in thewasm.h
header. These APIs are
enhanced in a number of respects:
Detailed error information is now available through a
wasmtime_error_t
. Currently this only exposes one function which is
to extract a string version of the error.There is a distinction now between traps and errors during
instantiation and function calling. Traps only happen if wasm traps,
and errors can happen for things like runtime type errors when
interacting with the API.APIs have improved safety with respect to embedders where the lengths
of arrays are now taken as explicit parameters rather than assumed
from other parameters.
alexcrichton merged PR #1467.
Last updated: Dec 23 2024 at 12:05 UTC