BlockstreamResearch / simfony

Rust-like high-level language that compiles down to Simplicity bytecode. Work in progress.
19 stars 6 forks source link

Add tuples #50

Closed uncomputable closed 2 months ago

uncomputable commented 2 months ago

Add tuple types and values. We need tuples to represent function arguments, which have heterogeneous types. Up to this point, we abused arrays for this purpose, because tuple and arrays have the same Simplicity structure. When we give Simfony proper types, this hack will no longer work.

Tuples subsume unit and product: Unit is the empty tuple and a product is a 2-tuple. For now, keep the grammar as before, which means only 0-tuples and 2-tuples are allowed.

Depends on #49

uncomputable commented 2 months ago

Rebased