Skip to content

Add global support#73

Merged
jbourassa merged 2 commits intomainfrom
globals
Dec 9, 2022
Merged

Add global support#73
jbourassa merged 2 commits intomainfrom
globals

Conversation

@jbourassa
Copy link
Copy Markdown
Collaborator

@jbourassa jbourassa commented Dec 8, 2022

Fixes #19

Add support for Wasm globals. Decisions worth validating:

  1. For creating GlobalTypes, I've chosen to define 2 constructors (GlobalType.const & GlobalType.var) instead of accepting mutability as an argument. It feels like a nicer UI, less error prone, and nothing precludes adding .new that takes a symbol argument if we ever need that.
  2. Following Wasmtime's naming, I'm calling a GlobalType Wasm type "content" (e.g. GlobalType#content -> :i32). This naming feels odd to me, but didn't want to diverge without a clear reason.

I'm looking into the memcheck failure but it does not look related to this PR, I can reproduce on main (edit: fix for memcheck in #75).

@saulecabrera
Copy link
Copy Markdown
Member

For creating GlobalTypes, I've chosen to define 2 constructors (GlobalType.const & GlobalType.var instead of accepting mutability as an argument. It feels like a nicer UI, less error prone, and nothing precludes adding .new that takes a symbol argument if we ever need that.

No objections on this. I actually prefer it this way.

Base automatically changed from table-minor-fixes to main December 9, 2022 13:42
@jbourassa jbourassa merged commit c61cfb4 into main Dec 9, 2022
@jbourassa jbourassa deleted the globals branch December 9, 2022 15:19
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.

Support Globals

2 participants