nervosnetwork / molecule

Another serialization system: minimalist and canonicalization.
MIT License
36 stars 23 forks source link

Support module reference in Molecule #58

Open doitian opened 2 years ago

doitian commented 2 years ago

Describe the Problem

Say I want to develop a CKB tool which uses the CKB core molecule structures and also has its own structures. If my tool structure uses any structure defined in CKB, I should copy CKB molecule scheme and generate the interfaces together. It means a lot of work because of #57. And in the language like Rust, all the generated CKB structures are not the same module, this hurts the interoperation between the different tools.

Suggested Solution

Support module reference in Molecule, so the code generator can skip some molecule schema file and import them via language package system. For the example above, it means we can use ckb_types instead of generating the CKB types again.