New type primitives? Bit shift definitions?

Community Forums/Monkey2 Talk/New type primitives? Bit shift definitions?

Nobuyuki(Posted 2015) [#1]
Will monkey2 have new type primitives like Byte and unsigned ints for handling better data chooching? Will Shr have its intended meaning? Will we get Sar/Sal?

Also, I'm totally requesting that if we do get more type prims, and if there are "short" and "long" ints, that the naming convention for these primitives explicitly include the number of bits in the name instead of going with the old convention where the number of bits for each integer is defined by the platform. int (an alias for 32-bit, IE: alias existing prims to their majority implementation width), int16, int64, float64, etc. instead of Short, Long, Word, Double, etc. Would rather see Byte instead of int8 though that may just be personal bias.


DruggedBunny(Posted 2015) [#2]
With regards to unsigned types, I wouldn't expect to see them (in fact, Mark's already suggested in another thread that there will only be signed types) -- this is why:

http://www.blitzbasic.com/Community/post.php?topic=41779&post=469173


Danilo(Posted 2015) [#3]
Mark said in thread Language features
Danilo asked:
What built-in simple/basic data types are planned? Signed and Unsigned types?
- Byte / UByte ? (8-bit)
- Word / UWord / Char ? (16-bit) - Char is 16bit with Unicode, would be 8bit with Ascii mode
- Long / ULong / DWord (32-bit)
- Quad / UQuad / LongLong / Int64 ? (64-bit)
- Int / Integer ? (Int32 if compiled 32bit, Int64 when compiled 64bit)
- Int8 / Int16 / Int32 / Int64 ?
- UInt8 / UInt16 / UInt32 / UInt64 ?
- Float / Single / Double ?
- String
- Bool


marksibly wrote:
At least the same as bmx: byte, short, int, long, float, double. All signed. byte and short are 8 and 16 bit, int/float and long/double are 'at least' 32 and 64 bit.

Characters will always look like ints to monkey code, but will be internally stored in at least 16 bit.



Nobuyuki(Posted 2015) [#4]
thanks fellas


Samah(Posted 2015) [#5]
And for the love of God make Shr non-arithmetic ie. >>
Sar for >>>


impixi(Posted 2015) [#6]
Signed byte? You jest?


Samah(Posted 2015) [#7]
@impixi: Signed byte? You jest?

Welcome to the world of Java. Most methods that read a byte return a short to allow 0-255.