Skip to content
Pre-release
Pre-release

@autodidaddict autodidaddict released this Sep 12, 2019 · 7 commits to master since this release

  • Extracted the guest/host boundary procedure call functionality into a new wapc crate that can be used by other projects
  • Renamed the import namespace so that guest modules now import host functions from wapc instead of wasm (this means modules built for Waxosuit prior to 0.3.0 will need to be recompiled)
Assets 3
Pre-release
Pre-release

@autodidaddict autodidaddict released this Sep 3, 2019 · 9 commits to master since this release

  • Upgraded the K/V capability (Redis) to include expiring keys and improved the get method to be more intuitive
  • Updated the interface so that __host_call and __guest_call now both return booleans (0=false, 1=true) indicating the success of the call. This saves the cost of an FFI call for the happy path.
Assets 3
Pre-release
Pre-release

@autodidaddict autodidaddict released this Aug 26, 2019 · 10 commits to master since this release

This release contains a breaking change to the RPC protocol used by Waxosuit and the guest SDK to communicate.

RPC changes

In the first public version of Waxosuit, the RPC mechanism contained explicit malloc and free calls. These would allow the host to allocate and release memory within the guest module. This concept only makes sense in the context of wasm-bindgen, which is designed to facilitate high-level interactions between JavaScript and the guest module to do things like object instantiation.

However, Waxosuit doe_not_ need object instantiation since it operates purely on an RPC principle. It does not manage or expose object lifetimes, and any data exchanged is assumed to only exist for the length of the RPC. We removed the use of malloc and free (see the wascap documentation for details). Now, there is a series of function calls made by the guest and host that are used for robust, error-handled RPC that can be initiated either by the host or by the guest.

A nice side-effect of this protocol simplification is that now that the payloads crossing the host/guest boundary are entirely opaque, the Rust guest SDK is now more ergonomic, developer-friendly, and requires less code. Further, by making these payloads opaque, we were able to remove the encode and decode penalties on both sides of the FFI border, reducing the function call latency.

Envelope Removal

As mentioned, we no longer use the Command and Event types from wascap-codec. Both of these were wrappers around a protobuf Any type, and so the encoding or decoding of any message also included a secondary encoding of the domain-specific payload. It also bled the event-sourcing internals of the Waxosuit runtime out into the public protocol. With these envelopes gone, the RPC mechanism is not only faster, but simpler and less confusing and it paves the way for future ergonomic improvements.

Error Handling

Error handling has been improved. By the nature of going through to factor out the envelope types, I had a chance to go over all the various code paths and I found a number of edge cases where errors would vanish, the wasm module would trap, and the Waxosuit host runtime's module thread would panic, essentially taking down the runtime. This has been fixed and we're now honoring the Result<T> type everywhere in the call hierarchy, so failures should no longer be able to panic the host thread, and your code can now rely on the Result<T> types returned by the various functions on the CapabilitiesContext in the guest SDK.

The work of the "unwrap() hunter" is never done, but things are in a far more stable place now.

Assets 3
You can’t perform that action at this time.