Tuple Layer Int Encoding

tuple.md documents multiple typecodes for integers. Couple of questions about this:

  • In the Go bindings, the tuple layer seems to choose the smallest type which could fit the value. Do any of the other implementation allow you to explicitly choose the value?
  • The arbitrary length integer is implemented for Go, and according to the markdown doc it’s implemented for Java and Python. Do any other languages implement it as well?

The current state of the Swift bindings allows you to stick in any kind of integer that can can encode itself with the appropriate type code. So explicitly choosing some size integer kind of works. This is, however, asymmetrical, so it’s possible it will get cleaned up.

bigint is an optional feature in the Rust bindings.

In some languages the shifting and masking just naturally overflows into bignums. Ruby is like that. And Common Lisp was, back when.