Stefan Manegold wrote:
Dear MonetDB developers,
I'm almost done with the first steps of adding two new integer atoms to MonetDB:
a) a tiny (8-bit) integer. Signed or unsigned? name: tint
Why not using int8, which also allows for nibbles int4, int2
b) a machine-word sized integer that grows with the system, i.e., 32-bit on 32-bit systems and 64-bit on 64-bit systems.
(a) is supposed to replace "chr" wherever "chr" is not used as a character type, but as a (tiny) 1-byte integer.
please keep 'chr', I don't mind if we use 'char' instead
(b) is supposed to be the MIL pendant of the C type "var_t" and can/should be used, e.g., for BUN counts of BATs which are limited to 32-bit on 32-bit systems, but can grow to 64-bit on 64-bit systems.
For now, I chose the following names, sticking to the 3-letter "design", and picking combinations that do not yet exist in the code base:
use full words, there is (implicit) design reason for it, but at a few places we may have to look a little further. For the cpu cycles freaks, you might use 'tiny' instead of 'bte', because 'bit' starts alsi with a 'b'
a) "bte" (read "byte") b) "wrd" (read "word")
In a first checking (hopefully sometime next week), I will only add these new atoms (and add the proper functionality & new signatures where necessary), but not change any existing MIL proc/command signatures.
In a second check-in (maybe also already next week?), I plan to change (at least) the signature(s) of "count(BAT[any,any]) : int" & "count(int) : lng" to a single "count(BAT[any,any]) : wrd".
Introduction of more atomary types leads to more coercions and signatures in M5. It may actually force me to introduce the union type property to keep things readable. But, if we have a union type constructor, why not making it a first class citizen? command bat.insert(b:bat[:any_1{type=void,int},:any_2{type=str,chr}....
Maybe, I/we should later also consider to replace "chr" by "bte" in the enum module.
Well, so far so good.
I would be grateful, if you could comment on these plans.
Especially, I'd like to hear, whether there are better(?) suggestions for the names "bte" & "wrd". Further, did I miss any places, where we should/must use "bte" iso. "chr" and/or "wrd" iso. "int"/"lng"?
Thank you very much in advance!
Stefan