rust-simplicity
rust-simplicity copied to clipboard
Remove TypeName and JetName?
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
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.
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 :)