google / google/wasefire

Improve interpreter error messages

Open
#42 0 comments 0 reactions 0 assignees View on GitHub
crate:interpreter for:usability good first issue needs:implementation
Dominant language
Rust
Stars
188
Forks
41
Avg merge
1d 5h
Merged PRs (30d)
12

Description

Currently, the interpreter just returns a field-less enum (essentially: invalid, not found, unsupported, and trap). This is not useful to understand what's wrong. It's possible to use the `debug` feature to get a backtrace, but that's also not ideal for debugging if not familiar with the interpreter.

The interpreter should provide a feature (or reuse `debug`) to return more descriptive error messages. For example:
- While linking module foo, the import bar::baz could not be found because bar is not an instance.
- While linking module foo, the import bar::baz could not be found because bar does not contain baz.
- While linking module foo, the import bar::baz could not be found types differ: expected function, got memory.
- While executing exported function bar::baz, an unreachable instruction was reached with the following stack trace: ...
- The wrong number of arguments was provided to invoke exported function bar::baz: expect [i32,f64], got [u32,u64].
- When an invalid opcode is parsed, the opcode should be returned.

The scheduler should also provide a `debug` feature (set from the runner from the feature of the same name).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.