thesuhas / orca

WebAssembly Transformation Library for the Component Model
Apache License 2.0
2 stars 0 forks source link

Creating intermediate representation for Mutations #1

Closed thesuhas closed 1 week ago

thesuhas commented 2 weeks ago

Currently copied over instrumentation from here. Need to extend to component model.

thesuhas commented 2 weeks ago

To extend to component model, need to add a Component struct and add the following:

thesuhas commented 1 week ago

@ejrgilbert @ahuoguo I'm almost done with the encoder function. I'm currently facing issues on trying to encode the ComponentTypeSection. There seem to be a few recursive structs and I'm not sure what the best way is to deal with them.

ComponentType has a ComponentTypeDeclaration variant which in turn has a ComponentType variant and it becomes recursive.

Similarly, InstanceTypeDeclaration has a ComponentType variant which in turn has a InstanceTypeDeclaration variant. I'm trying to see the best way to write this without duplicating code too much, which I fear has already become an issue.

The code is here if you want to check it out but I feel like it may not be that readable