PyHP_pph
PyHP_pph copied to clipboard
How will numbers work?
Is there just a basic number type? Is it like C(++) with long, double, int, etc? Is there signed and unsigned? Can you add "f" to the end of a number to treat it like a float? Is there hexadecimal support? Octal? Binary? When you type a number on its own, what type is it treated as? These are great topics for a specification if we can all agree on the details.
I suggest, since we are lacking in c# attributes, that we use int, double, and long.
Should everything be signed like C#? Or give the option like in C++?
I'd suggest that we give the option, but we should wait for more people's suggestions. (We can, of course, change the specs later.)
IMO everything should be binary or base 65536.
I think we should have C++-style primitive number types:
int(actually a long)float(actually a double)uint(unsigned)ufloat(unsigned)
But then again, I've always liked the idea of fixed-width integer types. i prefixes signed ints, u prefixes unsigned ones, and then you put the width in bits, so:
i8is like C(++)'ssigned char.u64is like C(++)'sunsigned long long.i32is like C(++)'sint(on most platforms).
But none of our inspiration languages do this (except C(++)'s xintxx_t types, but they're typedefed in stdint.h).
IIRC IL (the intermediate language C# compiles to) has Int32, Int16, Int64, etc.