sapio-lang/sapio

Redefine the core module return type to flatten/deduplicate some data

Opened this issue · 0 comments

Presently, a module has a return type of Object.

It might be nice if instead it returned a SapioCompilationType (or something) which could have some top-level deduplicated data structures (such as schemas for continuation points) to keep the returned output easier to read / more compact for consumers.

E.g.,

struct ContinuationPoint {
    /* */
   schema: SchemaIndex
}

struct SapioCompilationType {
  schemas: BTreeMap<SchemaIndex, Schema>,
  object:  Object
}