3 ms·
> BigInt types are in fact more or less List<Digit>, normal integer types just aren't implemented like that for performance reasons. Right. Because you only u
by Dylan16807 6y ago
> BigInt types are in fact more or less List<Digit>, normal integer types just aren't implemented like that for performance reasons.
Right. Because you only use BigInts, you don't use isolated BigInt digits.
> but then String would be the only type in your language that doesn't consist of any scalar element but always has an arbitrary length in every situation.
Sure, why not? Every type has something special about it. Integers have overflow, floats have precision, infinities, and NaN, and booleans don't map cleanly to bytes.
There's enough different ways to iterate over a string; you don't need a canonical way to decompose them, which is basically what a char type is. I wouldn't go as far as "mistake", but it's definitely fine to go without it.
> A char is the primitive type that makes up a string if chained together. It's more or less a practical naming convention, just like we can call a tuple of floats a vector.
For chars more complex than a byte, there are multiple practical conventions and it's hard to pick one.
For char=byte there's a very natural convention, and an array of bytes reflects what's actually in memory, but char=byte is something that should be avoided.
So it's either "none of these stand out" or "don't do this". So you might as well keep the language slightly simpler and not have a char type.