...
and when are we getting constants ? It is absolutely moronic not to have immutable constants like pi , e and other special numbers. everything is variable....
Not exactly. You could attach them to a class as read-only properties/descriptors, and get them from an instance. It is probably better to say that everything is a reference, but that is nit-picking until it isn't.
so i have to create an entire class with all associated hoopla ( instance creation et al ) to do something that could be done using a simple keyword
const pi = 3.17
print pi
class maths_constants
property get pi
return 3.17
end property
end class
print math_constants.pi
this is going the wrong way ... the less keyboard pounding i need to do the better. newer languages are supposed to make it faster and easier. not more cumbersome and elaborate. come to think of it. pi should be a baked-in constant that automatically casts to the precision of the target variable.
double x
x = pi yields 3.17+ 23 more digits
in x
x = pi
x is 3
single x
and languages really need to do away with this notion of integers and floats. there needs to be a uniform numerical type that automatically expands to the highest precision possible. i don't care about the compute time. the compiler can figure out what is the best mapping onto hardware
a= 2 , b =4, c = a+b : compiler would use unsigned integer math
a= 2 , b =4, c = a-b : compiler would use signed integer math.
a= 2 , b =4, c = b-a : compiler would use unsigned integer math since b is larger than a and thus negative number is ruled out.
tTe machine code can examine the contents of the variables , determine if they are signed or unsigned , integer or float , and decide what needs to be done. this can be done in a few instructions
No more shit like 'we tried to stuff a 32 bit number into 16 bits and all went to hell' no more need of cint ,cint16 and other stuff. you would retain those functions so you can cast when it is required for a specific purpose ( like bit twiddling in integers that drive i/o ) but a variable by default should be 'modeless' and the compiler can figure it out. unless i specifically tell it to be of a given type.
and if i tell it to be of a given type then conversion needs to be implicit.
var a,b 'modeless numbers
int x ' hard defined integer
a= 4
b = 3.14
x = a * b
' x containins 13 (4x3.14 was evaluated as float yielding 12.56. cast to integer = 13 ( rounded up )
x = round_down(a*b) . x contains 12
the compilers KNOW the type you gave , so why do yo need conversion functions ? they can figure out exactly what to do.