-
Notifications
You must be signed in to change notification settings - Fork 40
[2/x] Translate basic wallet Wasm component #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9920e70
to
e650342
Compare
1883b7a
to
422b8f7
Compare
fe0cbde
to
2d39974
Compare
cce1f5b
to
5c2cc0d
Compare
2d39974
to
1960cfd
Compare
hir-type/src/lib.rs
Outdated
@@ -65,6 +65,8 @@ pub enum Type { | |||
Struct(StructType), | |||
/// A vector of fixed size | |||
Array(Box<Type>, usize), | |||
/// A tuple of values of the given types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need a Tuple
type? A tuple is basically just an anonymous struct, there is no meaningful difference between them. I'd rather avoid introducing additional type-level abstractions if we can avoid it, since it requires handling that type in various places throughout the compiler, and we don't really want to do that unless it is actually semantically significant.
If there is a specific reason why StructType
is insufficient, let me know, but for now I'm going to leave it out of the rebased changes and use structs instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, not. I cannot find any reason why it cannot be represented as a struct.
Swap function calls to imported functions with the external function passed as module arguments.
according to the instantiation order
in the final stage of the translation to make the overall algorithm and steps more clear and concise. Raise errors when an particular item translation is not(yet) implemented.
temporary use of u64 for Felt in WIT.
5c2cc0d
to
eb3c0c9
Compare
Close #109
This PR is stacked on top of #127 and should be merged after it
This PR implements missing pieces in the Wasm CM translation needed for basic wallet example translation.
Wasm tables translation is not yet implemented, along with the
call_indirect
op translation (ignored) and are extracted into #133.This PR adds:
miden_hir::Type::Tuple
to represent Wasm CM tuple types;FuncEnvironment
forcall
op translation;ComponentTranslator
to make the overall algorithm and steps more clear and concise;Type::split
implementation forTuple
is temporarily plugged withtodo!
. Let me know if you want me to implement it.