motoko-base icon indicating copy to clipboard operation
motoko-base copied to clipboard

Can't find documentation for byte size representation of each candid type

Open ByronBecker opened this issue 3 years ago • 3 comments

Is there a specific location that documents what the byte size is of each candid/primitive type including variant, principal, ?T, <T>[], and ?<T>[].

I'm specifically interested in Nat, variant, and ?<Principal>[], but I'd imagine others will eventually wonder about the other types as well.

ByronBecker avatar Nov 30 '22 09:11 ByronBecker

It can be inferred from https://github.com/dfinity/candid/blob/master/spec/Candid.md, but not very accessible.

I think there was a forum post discussing this?

nomeata avatar Nov 30 '22 10:11 nomeata

Are you referring to https://forum.dfinity.org/t/what-is-the-maximum-value-of-nat64-nat32-nat16-nat8-int64-int32-int16-and-int8/11735 ?

For me it would just be nice if it was in one place, or at the top of each .mo file in the base library for which the /// doc comment would reflect this on the developer documentation site.

Or maybe just a wiki/searchable doc page.

ByronBecker avatar Nov 30 '22 10:11 ByronBecker

Can't find it right now. Maybe it was about the memory representation in Motoko instead.

nomeata avatar Nov 30 '22 11:11 nomeata