digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
801 stars 203 forks source link

replace js codegen module ref tracking with the daml-lf-ast version #13845

Open S11001001 opened 2 years ago

S11001001 commented 2 years ago

DA.Daml.LF.Ast.Optics provides a suite of functions whose main use is finding the referenced modules on pretty much every part of the AST.

While we use typeModuleRef from this module as part of figuring out module refs in TypeScript codegen, it seems that we do a lot of calculating of Set ModuleRefs that just might be redoing the work of this module.

We should see whether all of the module ref tracking in TsCodeGenMain can't be replaced with some well-chosen invocations of the traversal provided by Optics. That would probably have precluded #13754, and may also help us avoid similar bugs that might arise with future LF features.

stefanobaghino-da commented 2 years ago

@S11001001 is this gardening? If not, feel free to remove the label I just added.