bytecodealliance / bytecodealliance/wasmtime

Improvement and Creation of Official Cranelift tutorial

Open
#10,005 1 comment 0 reactions 0 assignees View on GitHub
cranelift:docs
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

### Updated Official Cranelift Tutorial

I personally came to Cranelift as an [LLVM](https://llvm.org) alternative because LLVM was giving me trouble specifically with linking errors on my windows machine. I had high hopes going into using Cranelift because it just worked with the very helpful [cranelift-jit-demo](https://github.com/bytecodealliance/cranelift-jit-demo). Although after this first success, there was a lot of frustration because the demo is now outdated especially the `faerie` branch and there is basically no other tutorials out there for Cranelift besides this [brainfuck compiler](https://rodrigodd.github.io/2022/10/21/bf_compiler-part1.html) I found.

For me, a newbie to Cranelift, trying to incorporate a compiler for my programming language project was very **frustrating**. Especially trying to use the `cranelift-object` module. Chat GPT and copilot where not very helpful either 😭. I really wanted it to work because I think Cranelift is such an **awesome piece of software** but I just couldn't seem to do it. That's why I think an _up-to-date_ tutorial for Cranelift would be very beneficial for people like me trying to make a compiler without using LLVM. I imaging it would be similar to the [Kaleidoscope](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html) tutorial that LLVM uses.

#### Alternatives

I understand that this would be a big undertaking. If this is too much for now, an updated toy demo would work well. Specifically, one that doesn't use the outdated `faerie` module.

#### Suggestions

A very simple toy language similar to the [cranelift-jit-demo](https://github.com/bytecodealliance/cranelift-jit-demo) would be very beneficial. Especially if it would be kept up-to-date with the latest versions of Cranelift. And if someone had extra time, incorporating multiple types. For me at least, part of the pain was trying to use the `cranelift-object` module, so maybe incorporating that into the tutorial would be helpful.

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.