Stream: wasmtime

Topic: ModuleTypes & TypeRegistry


view this post on Zulip Jonas Kruckenberg (Nov 06 2024 at 07:21):

Heya people, quick double checking my understanding: The only reason why wasmtime splits type canonicalization into a ModuleTypes and TypeRegistry “phase” is so that a parsed module can be cached on disk and loaded back in a different session right?

view this post on Zulip Jonas Kruckenberg (Nov 06 2024 at 07:21):

or is there some other idk component model requirement for this?

view this post on Zulip Alex Crichton (Nov 06 2024 at 15:39):

Yes the main motivation for this is AOT compilation (in one form or another). This enables creating a separate artifact from an engine which can later get merged into an engine and loaded at runtime. Nothing to do with components, just the compilation model that we have

view this post on Zulip fitzgen (he/him) (Nov 06 2024 at 16:59):

yeah, to add a little more color:

view this post on Zulip fitzgen (he/him) (Nov 06 2024 at 16:59):

it might even make sense to rename these things to like CompileTimeTypes and RuntimeTypes or something

view this post on Zulip Jonas Kruckenberg (Nov 06 2024 at 18:54):

aye alright thanks for taking the time :) thats what I figured too :+1:

view this post on Zulip Jonas Kruckenberg (Nov 06 2024 at 18:56):

ive been wondering since Ive seen firefox do just do global type canonicalization but given wasmtime cares more about instantiation time than compilation that checks out

view this post on Zulip Lann Martin (Nov 06 2024 at 19:46):

I CAN LEARN WHEN I'M DEAD

view this post on Zulip Lann Martin (Nov 06 2024 at 19:47):

wait...

view this post on Zulip Jonas Kruckenberg (Nov 07 2024 at 14:13):

for future reference: there is one more advantage to this two-step process i realized after implementing a half-assed oneshot system yesterday. building up rec groups first and then canonicalizing them through hash consing is much much cleaner than trying to do it all at once

view this post on Zulip Jonas Kruckenberg (Nov 07 2024 at 14:14):

so i went with copying your implementation after all :) we’ll see if that needs tweaking for my needs when I get around to benchmarking


Last updated: Dec 23 2024 at 13:07 UTC