rust-simplicity icon indicating copy to clipboard operation
rust-simplicity copied to clipboard

Remove TypeName and JetName?

Open uncomputable opened this issue 3 years ago • 2 comments

We might be able to replace TypeName with lazy const / static Types. This would be useful, since TypeName exists as a hack to generate Types on demand.

Similarly, we might be able to replace JetName and somehow include all the information from JetNode in the enum. This would be useful, because it would guarantee that each jet name refers to exactly one jet. At the moment, we could readily define two jets with the same JetName and this would cause all kinds of havoc.

Originally posted by @apoelstra in https://github.com/ElementsProject/rust-simplicity/issues/26#issuecomment-1160601481

uncomputable avatar Jul 09 '22 17:07 uncomputable

JetNode and JetName have been replaced with Jet in #44 . TypeName still exists, but it is hard (impossible?) to represent a finalised type with heap allocations in compile-time code. We might not get around having functions that return a finalised type given some handle.

uncomputable avatar Nov 21 '22 13:11 uncomputable

cc https://github.com/rust-bitcoin/rust-miniscript/issues/484 which is a related issue.

Let's put this one on the back burner until we have some big insight about how to represent closely-related tree structures in Rust :)

apoelstra avatar Nov 21 '22 14:11 apoelstra