-sys
library design principlesIn general, the -sys
library should keep only unsafe
C interface bindings and should not have redundant security abstractions.
However, for a pure Rust SDK like wasmedge-rs
that we will eventually build, there should not be too many C binding interfaces. So, the wasmedge-sys
library uses a thin layer of Rust wrappers, exposing only the appropriate interfaces for the upper layer of wasmedge-rs
to abstract a more usable pure Rust SDK.
The interfaces exposed by the -sys
library are supposed to be stable. That is, when the C interface changes, only the -sys
library needs to be changed, not the upper-layer SDK.
ErrReport
structures uniformly, and do further Rust-style error handling in the upper-level -wasmedge-rs
SDK.-sys
library, e.g. Strings/Value etc., which the upper level SDK just needs to use.-sys
library as the base interface for the SDK.C-API
header file and the corresponding Rust binding interface are recorded in the Dosc directory as documentation.