Is there an effective way to represent a 64-bit Unsigned Integer in Pkl? #481
-
Hello Pkl Team, One of the Istio classes I need has a property of type Do you have any recommendations on handling |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Because all of Pkl's Similar needs have come up in the past. |
Beta Was this translation helpful? Give feedback.
Because all of Pkl's
(U)Int??
types are range-constrained type aliases ofInt
, they're all stored signed (and 64 bits) under the hood. SupportingUInt64
(or even other larger integers) is definitely a current, known shortcoming of the language and I'd encourage you to file an issue about it!Similar needs have come up in the past.
pkl.experimental.net
needs aUInt128
implementation to work with IPv6 addresses and it uses a class composed of 4UInt
s to do so: https://github.com/apple/pkl-pantry/blob/main/packages/pkl.experimental.net/u128.pkl