Basil should support integer types with widths less than 64 bits.
Similar to Go's primitive int types, I propose redefining the current Int type as a generic "best size" integer type equal to the word size of the target architecture. We'll augment this with types with explicit sizes: I propose I8, I16, I32, and I64 for brevity's sake.
Some open questions associated with this feature:
- Should we include unsigned integers in the language? What should their semantics be (specifically w.r.t. type coercion)?
- Is there a compelling reason to define a distinct equivalent of C's
intptr_t? Word-sized Int should be equivalent to this on most modern systems - perhaps we could even specifically define Int as pointer-sized?
- Should we consider generalizing ints for arbitrary bit-widths?
I128 could have some uses. What about atypicalwidths like I7 or I50?
Basil should support integer types with widths less than 64 bits.
Similar to Go's primitive int types, I propose redefining the current
Inttype as a generic "best size" integer type equal to the word size of the target architecture. We'll augment this with types with explicit sizes: I proposeI8,I16,I32, andI64for brevity's sake.Some open questions associated with this feature:
intptr_t? Word-sizedIntshould be equivalent to this on most modern systems - perhaps we could even specifically defineIntas pointer-sized?I128could have some uses. What about atypicalwidths likeI7orI50?