Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement and Creation of Official Cranelift tutorial #10005

Open
JBrosDevelopment opened this issue Jan 14, 2025 · 1 comment
Open

Improvement and Creation of Official Cranelift tutorial #10005

JBrosDevelopment opened this issue Jan 14, 2025 · 1 comment

Comments

@JBrosDevelopment
Copy link

JBrosDevelopment commented Jan 14, 2025

Updated Official Cranelift Tutorial

I personally came to Cranelift as an LLVM 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. 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 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 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 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.

@cfallin
Copy link
Member

cfallin commented Jan 16, 2025

Hi @JBrosDevelopment -- thanks for filing the issue! We've wanted to expand our documentation for a while -- unfortunately we haven't had folks with enough cycles to build out an example like you describe. (We're pretty thinly staffed, with something like 100x fewer contributors than LLVM.) If anyone is interested in building out an example (the "hard way" using just our API docs) and then writing about it, we'd be happy to review additions to the docs. In the meantime, please do feel free to ask questions on our Zulip instance, and there are usually folks around who can answer specific questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants