Refactor runtime #21

Closed
opened 2022-11-02 22:02:17 +00:00 by mars · 0 comments
Owner

ScriptAbi/ScriptAbiImpl are overcomplicated and mocks should be data-oriented instead of trait-oriented. The generics in WasmtimeRuntime are a pain in the ass for using the API. It is difficult (in theory, because the only backend is Wasmtime right now) to share data between backends without duplicating code. PanelId is clunky to use directly.

  1. Add a backends module for different runtime backends.
  2. Add Backend and Instance traits for backend scripting implementations.
  3. Move all Wasmtime code into backends::wasmtime and implement backend traits.
  4. Add a Runtime struct that uses dynamic trait boxes for the backend.
  5. Update Magpie and the sandbox to use the new API.
`ScriptAbi`/`ScriptAbiImpl` are overcomplicated and mocks should be data-oriented instead of trait-oriented. The generics in `WasmtimeRuntime` are a pain in the ass for using the API. It is difficult (in theory, because the only backend is Wasmtime right now) to share data between backends without duplicating code. `PanelId` is clunky to use directly. 1. Add a `backends` module for different runtime backends. 2. Add `Backend` and `Instance` traits for backend scripting implementations. 3. Move all Wasmtime code into `backends::wasmtime` and implement backend traits. 4. Add a `Runtime` struct that uses dynamic trait boxes for the backend. 5. Update Magpie and the sandbox to use the new API.
mars added the
cleanup
api change
labels 2022-11-02 22:02:17 +00:00
mars self-assigned this 2022-11-02 22:02:17 +00:00
mars closed this issue 2022-11-02 23:50:39 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: canary/canary-rs#21
No description provided.