Probably shouldn't be using usize
for uplc values
#194
Replies: 3 comments
-
This is mostly fine. The only place we are using a usize in uplc is for the Debruijn index and I believe the Haskell code uses some equivalent type, in practice the number doesn't seem to get very big anyways. @MicroProofs do you recall why we used usize to represent |
Beta Was this translation helpful? Give feedback.
-
Debruijn is an exception where they used Word64, but in most cases values in the Haskell plutus used Integer which is a int of any size. To emulate this same behavior in rust we used isize and usize as appropriate. I am open to review individual cases to switch to a set size for where it makes sense. Right now we allowed for the maximum flexibility and are open to tightening that. |
Beta Was this translation helpful? Give feedback.
-
Oops I made a duplicate issue #47. But in there I describe a possible format to support any integer. Give it a look and let me know |
Beta Was this translation helpful? Give feedback.
-
Since
usize
is defined by the architecture of the machine, it's not consistent. It probably would be good to choose something that is more consistent, and hopefully the same as the Plutus Core spec.Beta Was this translation helpful? Give feedback.
All reactions