Skip to content

Conversation

@simvux
Copy link
Contributor

@simvux simvux commented Jun 3, 2025

#cranelift > Cranelift Examples Repository

cranelift-examples is an attempt at documenting the various (often higher-level) questions people tend to have when learning to use Cranelift as a compiler backend. The goal is to have examples that address very specific topics in a predictable format with lots of comments that not only explain what the Cranelift code does, but also explains the topic more broadly.

@simvux simvux requested a review from a team as a code owner June 3, 2025 16:57
@simvux simvux requested review from abrown and removed request for a team June 3, 2025 16:57
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and for putting together these examples! A suggested change to wording below but otherwise I'm happy to see this merged in.

[Wasmtime]: https://github.com/bytecodealliance/wasmtime

For various examples of how to use Cranelift to accomplish common compiler
tasks, see the [Cranelift Examples] repository.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this a little more explicit about the third-party maintenance -- perhaps something like "For various examples of how to use Cranelift to accomplish common compiler tasks, in addition to the above, @simvux maintains a [Cranelift Examples] repository." ?

Copy link
Contributor Author

@simvux simvux Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Although not sure about the wording. "in addition to above" could be misinterpreted as me maintaining the JIT demo.

Copy link
Member

@cfallin cfallin Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sure, I had just meant to indicate that it's another set of examples, but no need for that phrase I suppose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just

For various examples of how to use Cranelift to accomplish common compiler
tasks, see the [Cranelift Examples] repository maintained by @simvux.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cfallin cfallin enabled auto-merge June 3, 2025 17:15
@cfallin cfallin added this pull request to the merge queue Jun 3, 2025
@pchickey
Copy link
Contributor

pchickey commented Jun 3, 2025

Thanks @simvux for helping show more folks how to use cranelift. If your project grows to have more contributors and you'd like to contribute these examples to the bytecode alliance, you could consider making a proposal in bytecodealliance/governance (like this one) to shift the project over here and make it more official. The most important bar to reach there, in my opinion, is the requirement for a Sustainable Contributor Base, see that section of the proposal. You may also want to connect with the sig-docs folks on the Bytecode Alliance zulip.

Merged via the queue into bytecodealliance:main with commit 583655a Jun 3, 2025
41 checks passed
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
* Add link to Cranelift Examples

* clarify that Cranelift Examples is third-party maintained
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants