Firestar99 opened PR #13335 from Firestar99:isle_tuple_fields to bytecodealliance:main:
Requires https://github.com/bytecodealliance/wasmtime/pull/13319
This is a stacked PR and the above PR must be merged first. Unfortunately, I can't change the base to be that PR due to github limitations, so please only review the top commit. I'll keep this one a draft until the above is merged.
Adds support for tuple-like field declarations in isle:
(type A (struct u32 u32)) (type B (enum (Ba (x u32)) (Bb u32 u32 u32))) (type D (enum (Da A) (Db B) (Dc)))Which codegen's types like these:
/// Internal type A: defined at isle_examples/run/tuple_variants.isle line 0. #[derive(Clone, Debug)] pub struct A(pub u32, pub u32); /// Internal type B: defined at isle_examples/run/tuple_variants.isle line 1. #[derive(Clone, Debug)] pub enum B { Ba { x: u32, }, Bb(u32, u32, u32), } /// Internal type D: defined at isle_examples/run/tuple_variants.isle line 4. #[derive(Clone, Debug)] pub enum D { Da(A), Db(B), Dc, }As mentioned in https://github.com/bytecodealliance/wasmtime/pull/13319, I have an external enum with tuple-like fields that I would like to model in isle without modifying the existing data structure, if possible:
pub enum MInst { IAdd(IAdd), IConst(IConst), }
Firestar99 updated PR #13335.
Firestar99 edited PR #13335:
Requires https://github.com/bytecodealliance/wasmtime/pull/13319
This is a stacked PR and the above PR must be merged first. Unfortunately, I can't change the base to be that PR due to github limitations, so please only review the top commit. I'll keep this one a draft until the above is merged.
Adds support for tuple-like field declarations in isle:
(type A (struct u32 u32)) (type B (enum (Ba (x u32)) (Bb u32 u32 u32))) (type D (enum (Da A) (Db B) (Dc)))Which codegen's types like these:
/// Internal type A: defined at isle_examples/run/tuple_variants.isle line 0. #[derive(Clone, Debug)] pub struct A(pub u32, pub u32); /// Internal type B: defined at isle_examples/run/tuple_variants.isle line 1. #[derive(Clone, Debug)] pub enum B { Ba { x: u32, }, Bb(u32, u32, u32), } /// Internal type D: defined at isle_examples/run/tuple_variants.isle line 4. #[derive(Clone, Debug)] pub enum D { Da(A), Db(B), Dc, }As mentioned in https://github.com/bytecodealliance/wasmtime/pull/13319, I have an external enum with tuple-like fields that I would like to model in isle without modifying the existing data structure, if possible:
pub enum MInst { IAdd(IAdd), IConst(IConst), }I derived the ast and sema type names from Rust's grammar.
github-actions[bot] added the label cranelift on PR #13335.
github-actions[bot] added the label isle on PR #13335.
github-actions[bot] commented on PR #13335:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
:thumbs_up: cfallin submitted PR review:
Last commit generally looks LGTM -- thanks! Happy to land this once the precursor PR lands and this is rebased.
:speech_balloon: cfallin created PR review comment:
probably fine to use
usizehere? I don't imagine the universe fitting the memory required to describe 2^128 tuple fields...
Firestar99 updated PR #13335.
Firestar99 updated PR #13335.
Firestar99 has marked PR #13335 as ready for review.
Firestar99 commented on PR #13335:
Rebased ready to merge
Firestar99 requested fitzgen for a review on PR #13335.
Firestar99 requested wasmtime-compiler-reviewers for a review on PR #13335.
Firestar99 edited a comment on PR #13335:
Rebased ready to merge, thx for the reviews :heart:
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin has enabled auto merge for PR #13335.
cfallin added PR #13335 isle tuple structs and enum variants to the merge queue.
:check: cfallin merged PR #13335.
cfallin removed PR #13335 isle tuple structs and enum variants from the merge queue.
Last updated: Jun 01 2026 at 09:49 UTC