-
Notifications
You must be signed in to change notification settings - Fork 24
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
[3/x] Link Miden packages without cross-context calls lifting/lowering #353
Conversation
@bitwalker We need high-level type signatures to link a Miden package - #354 |
3d9b15e
to
56d45c1
Compare
call
generationcall
generation
call
generation2466128
to
73262e3
Compare
and exports and use proper Wasm CM names
Wasm CM names for intrinsics, stdlib, tx kernel.
assembling Library
…ports in basic wallet test
When building a basic wallet Miden package in the p2id test.
56d45c1
to
6745c3f
Compare
@greenhat Yes, high-level type signatures in Miden are something I'll be adding starting in a week or possibly at the start of the new year. Once added, they'll exist at the same level of abstraction as core Wasm signatures (albeit more useful, since not everything will be reduced to A couple notes about some of the decisions made here:
I'm going to review/merge this under the assumption that we'll address any of the above in future PRs, but wanted to bring them up to ensure they are something we don't forget to deal with once the IR refactoring is merged (or as part of merging it). |
let mut mast_forest = lib.mast_forest().as_ref().clone(); | ||
mast_forest.advice_map_mut().extend(advice_map); | ||
let converted_exports = recover_wasm_cm_interfaces(&lib); | ||
let lib = CompiledLibrary::new(Arc::new(mast_forest), converted_exports)?; |
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.
Note: When wiring up HIR2 to the frontend, the lowering from Wasm to HIR will need to create Interface
operations in the top-level Component
which contain Function
ops corresponding to the exports of component instances in the original Wasm component. The Component
operation will also contain component-level function exports and Module
s corresponding to the core Wasm modules present in the original Wasm component. See Component Translation for further details.
The new codegen crate no longer has its own Miden Assembly IR, so the Library
and Program
structs no longer exist. To the extent that some of this stuff still exists (by which I mean things like assembling to MAST, late-stage linking and the like), it will either be done in the new Linker
(which is much simpler than the current one, and runs just prior to codegen, rather than as a initial part of lowering into HIR), or in the compiler driver (i.e. in an appropriate Stage
of the compiler). I expect that a lot of this will no longer be necessary though, since the new representation is more faithful to the Component Model, so fewer contortions are required to lower into Miden Assembly than we currently are forced to do.
Close #351
Close #346
Ref #303
This PR is stacked on the #356 and should be merged after it
This PR links P2ID note script with the basic wallet Miden package, ignoring the lifting/lowering of the cross-context calls. The cross-context calls will be addressed in the subsequent PR(s).
Since this PR contains quite a few changes in various parts of the compiler, I suggest going by commits for the review process.
This PR makes the following decisions:
intrinsics
, etc. modules;Component
will be used in compiler pipeline instead ofModule
and lifting/lowering will be done in separate modules so most likely this workaround will not be necessary#anon
namespace is used with Wasm CM interface (miden:basic-wallet/[email protected]
) resulting in#anon::miden:basic-wallet/[email protected]
string as the export module name;Linker::allow_missing
with linked library's exports (with removed#anon
namespace);