sapio-lang / sapio

A Bitcoin Programming Language
Mozilla Public License 2.0
244 stars 43 forks source link

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

Open JeremyRubin opened 2 years ago

JeremyRubin commented 2 years ago

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
}