Skip to content

Update the guest C generator for world-based generation#396

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:c-world
Oct 25, 2022
Merged

Update the guest C generator for world-based generation#396
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:c-world

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit removes the Generator trait impl for the C generator and adds the WorldGenerator trait impl to replace it. This is the equivalent of #386 for the guest C generator.

The generated C code is largely the same, except that the entire world is represented in one header file instead of per-interface header files as before. Additionally a tiny amount of "type sharing" is now done where all interfaces share the same string type (namespaced by the world name). More type sharing should come with a more first-class implementation of worlds.

There was quite a lot of code movement within the generator as I got it working again, but at the surface level very little has changed and it should largely be the same as before.

@alexcrichton alexcrichton requested a review from pchickey October 25, 2022 16:21
@alexcrichton
Copy link
Copy Markdown
Member Author

This'll certainly conflict with #392 so I think it's best to hold off on merging this until that's in.

This commit removes the `Generator` trait impl for the C generator and
adds the `WorldGenerator` trait impl to replace it. This is the
equivalent of bytecodealliance#386 for the guest C generator.

The generated C code is largely the same, except that the entire world
is represented in one header file instead of per-interface header files
as before. Additionally a tiny amount of "type sharing" is now done
where all interfaces share the same string type (namespaced by the
world name). More type sharing should come with a more first-class
implementation of worlds.

There was quite a lot of code movement within the generator as I got it
working again, but at the surface level very little has changed and it
should largely be the same as before.
@alexcrichton alexcrichton merged commit 9d7b320 into bytecodealliance:main Oct 25, 2022
@alexcrichton alexcrichton deleted the c-world branch October 25, 2022 21:17
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.

2 participants