summaryrefslogtreecommitdiff
path: root/ARCHITECTURE.md
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-01-29 17:53:39 +0100
committerHenry Gressmann <mail@henrygressmann.de>2024-01-29 17:53:39 +0100
commit4c9385df1bcc0098c7e1db7a2f7c7e3dbeb00c8b (patch)
tree5fd85465d424b509a0fede850b079f3534f944a8 /ARCHITECTURE.md
parentb0b4eba3b7ff5bfbcb8835c473ac3945c5160332 (diff)
chore: improve docs
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'ARCHITECTURE.md')
-rw-r--r--ARCHITECTURE.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index 9665745..28607da 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -12,6 +12,7 @@ Some key differences are:
- TinyWasm is architectured to allow for a JIT compiler to be added later. Functions are stored as FunctionInstances which can contain either a `WasmFunction` or a `HostFunction`. A third variant `JitFunction` could be added later to store a pointer to the compiled function. This would allow for the JIT to be used transparently without changing the rest of the runtime.
- TinyWasm is designed to be used in `no_std` environments. The `std` feature is enabled by default, but can be disabled to remove the dependency on `std` and `std::io`. This is done by disabling the `std` and `parser` features. The `logging` feature can also be disabled to remove the dependency on `log`. This is not recommended, since `libm` is not as performant as the compiler's math intrinsics, especially on wasm32 targets, but can be useful for resource-constrained devices or other environments where `std` is not available such as OS kernels.
- Call Frames are executed in a loop instead of recursively. This allows the use of a single stack for all frames and makes it easier to pause execution and resume it later, or to step through the code one instruction at a time.
+- While other interpreters convert `locals` to be register-based when parsing the function body, TinyWasm keeps them in a stack. This is mostly for simplicity in the implementation, but performance is still comparable or better than other interpreters.
## Bytecode Format