-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
planned featurePlanned feature for upcoming language revision.Planned feature for upcoming language revision.
Description
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-sizedInt
should be equivalent to this on most modern systems - perhaps we could even specifically defineInt
as pointer-sized? - Should we consider generalizing ints for arbitrary bit-widths?
I128
could have some uses. What about atypicalwidths likeI7
orI50
?
Metadata
Metadata
Assignees
Labels
planned featurePlanned feature for upcoming language revision.Planned feature for upcoming language revision.