bytecodealliance / bytecodealliance/wasmtime
improve/document examples in `wasmtime/cranelift/jit/`
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Hi, I just came from https://github.com/bytecodealliance/cranelift-jit-demo which is nice, documented and pretty straightforward (although has some [todo comments left there 3-4 years ago](https://github.com/bytecodealliance/cranelift-jit-demo/blob/2e1fd35e78bb64c0df0a835cc6199b377fd0fb9a/src/jit.rs#L53-L55))
#### Improvement
Add more examples of different complexity (basic to medium and maybe some complex ones), document them with explanations of what's what (like it is done in [cranelift-jit-demo](https://github.com/bytecodealliance/cranelift-jit-demo))
#### Implementation
Think of some simple examples and use-cases that incorporate jit, it could be something like compiled regex or other type of state machine pattern, then add examples commenting every jit and cranelift-specific step to avoid confusion and provide guidance.
Show how to define functions, work with data, leave useful notes to external resources (at least to Wikipedia).
#### Benefit
Newcomers like me will be able to understand what is going on there and how they can use cranelift jit to build their own ~~blazingly fast~~ & feature packed language.
p.s. now I'm trying to explore cranelift-jit-demo and it is looking good so far, I like it.
Contributor guide
Assessment
This issue has not been assessed yet.