DConf 2013 Day 2 Talk 6: Higgs, an experimental JIT compiler written in D by Maxime Chevalier-Boisvert
Jonathan M Davis
jmdavisProg at gmx.com
Sat Jun 8 21:03:37 PDT 2013
On Saturday, June 08, 2013 15:55:17 Walter Bright wrote:
> On 6/8/2013 2:23 PM, bearophile wrote:
> > - D integer types have guaranteed sizes, but
> >
> > they're not obvious from the name
> >
> > - Why not have int8, uint8, int32, uint32, etc. in
> >
> > default namespace, encourage their use?
> >
> > I agree. It's hard to guess the size and signedness of types as byte,
> > ubyte, wchar, dchar. I prefer names that are more clear.
>
> It would only be a trivial problem for 5 minutes, only for ex-C/C++
> programmers who are used to suffering under variable sized ints, and will
> never be a problem again.
>
> Is it really a problem to guess the size of 'byte'? Or that 'ubyte' is
> unsigned? Come on, bearophile!
>
> And frankly, int32, long64, etc., have a large 'yech' factor for me.
>
> Besides, if you really do want them,
>
> import core.stdc.stdint;
If I had been designing the language, I might have gone for int8, uint8,
int16, uint16, etc. (in which case, _all_ of them would have had sizes with no
aliases without - it seems overkill to me to have both), but I also don't
think that it's a big deal for them to not have the numbers either, and I
don't understand why anyone would think that it's all that hard to learn and
remember what the various sizes are - especially when Java did something very
close to what we did, and programmers seem to be fine with that. And the signed
vs unsigned integers should be generally clear given that all of the integral
types which are unsigned start with u and all those that don't, don't. The
only exception is size_t which is already a bit of an oddity among the others,
since its size can vary.
So, while some people might find the sizes of the types to be a little
confusing at first, I find it very hard to believe that anyone finds them to be
confusing for long. It's all quite straightforward on the whole.
- Jonathan M Davis
More information about the Digitalmars-d-announce
mailing list