D - size of type
- nicO (13/13) Aug 24 2001 My post called "OpenMP, and set" is maybe to big, nobody give an answer
- Walter (2/15) Aug 24 2001
- Angus Graham (4/9) Aug 24 2001 Personally I've never had a problem with:
- nicO (11/25) Aug 25 2001 The idea is to improve the language. Simple int is composed by 16, 32 or
- Angus Graham (8/17) Aug 25 2001 I guess I wouldn't be opposed to this ranged system, as long as plain ol...
My post called "OpenMP, and set" is maybe to big, nobody give an answer to it. One of the proposal is to use interval instead of type. ex: [0..15] i; //to define a little integer which could became a 8 or even 4 bits integer depending of the cpu. A letter could be used to defined from which mathematical set the number should come from math (N,Q,R,...). ex: N[0..15] i; R[10.0..2000.3] f; So it could be possible to make an analyse to verify that i should never exeded 15. It could be done dynamicaly or staticly (cf the previous post). nicO
Aug 24 2001
I was thinking of adding that as an extension in version 2. -Walter nicO wrote in message <3B869A3C.AC3A1725 ifrance.com>...My post called "OpenMP, and set" is maybe to big, nobody give an answer to it. One of the proposal is to use interval instead of type. ex: [0..15] i; //to define a little integer which could became a 8 or even 4 bits integer depending of the cpu. A letter could be used to defined from which mathematical set the number should come from math (N,Q,R,...). ex: N[0..15] i; R[10.0..2000.3] f; So it could be possible to make an analyse to verify that i should never exeded 15. It could be done dynamicaly or staticly (cf the previous post). nicO
Aug 24 2001
"nicO" <nicolas.boulay ifrance.com> wroteOne of the proposal is to use interval instead of type. ex: [0..15] i; //to define a little integer which could became a 8 or even 4 bits integer depending of the cpu. A letter could be used to defined from which mathematical set the number should come from math (N,Q,R,...).Personally I've never had a problem with: int Angus Graham
Aug 24 2001
Angus Graham a écrit :"nicO" <nicolas.boulay ifrance.com> wroteThe idea is to improve the language. Simple int is composed by 16, 32 or 64 bits ? How to choose ? If you give a range the compiler could use the best size for the targeted cpu. You could say 32 is enought. Most of the time yes. But with new SIMD stuff, it could be very interresting to know if 16 will not be enought because twice number of operations could be perform in the same time. Beside that some "proofs" could be done on the program. (such value is never reach and so on) To make safer program, it could be very interresting. nicOOne of the proposal is to use interval instead of type. ex: [0..15] i; //to define a little integer which could became a 8 or even 4 bits integer depending of the cpu. A letter could be used to defined from which mathematical set the number should come from math (N,Q,R,...).Personally I've never had a problem with: int Angus Graham
Aug 25 2001
"nicO" <nicolas.boulay ifrance.com>I guess I wouldn't be opposed to this ranged system, as long as plain old "int" was still there. I need to be able to do a certain amount of my coding with my brain in "off" mode. I don't want every time I create an integer variable to have to ask myself "hmm, what is the range of this number?" Right now I can just think "Is two billion enough?" And the answer is always yes. AngusPersonally I've never had a problem with: intThe idea is to improve the language. Simple int is composed by 16, 32 or 64 bits ? How to choose ? If you give a range the compiler could use the best size for the targeted cpu. You could say 32 is enought. Most of the time yes. But with new SIMD stuff, it could be very interresting to know if 16 will not be enought because twice number of operations could be perform in the same time
Aug 25 2001
Angus Graham a écrit :"nicO" <nicolas.boulay ifrance.com>A typedef could be used to defined what is a int. So there is no problem for it. So for security raison and performance, given a more precise hint, will help a lot the compiler. nicOI guess I wouldn't be opposed to this ranged system, as long as plain old "int" was still there. I need to be able to do a certain amount of my coding with my brain in "off" mode. I don't want every time I create an integer variable to have to ask myself "hmm, what is the range of this number?" Right now I can just think "Is two billion enough?" And the answer is always yes.Personally I've never had a problem with: intThe idea is to improve the language. Simple int is composed by 16, 32 or 64 bits ? How to choose ? If you give a range the compiler could use the best size for the targeted cpu. You could say 32 is enought. Most of the time yes. But with new SIMD stuff, it could be very interresting to know if 16 will not be enought because twice number of operations could be perform in the same timeAngus
Aug 26 2001
Angus Graham wrote in message <9m9n85$d2v$1 digitaldaemon.com>...I guess I wouldn't be opposed to this ranged system, as long as plain old "int" was still there. I need to be able to do a certain amount of my coding with my brain in "off" mode. I don't want every time I create an integer variable to have to ask myself "hmm, what is the range of this number?" Right now I can just think "Is two billion enough?" And the answer is always yes.I think you're on to something. D offers lots of help from the compiler and runtime for finding bugs, but it's also designed so you can just bang out quick & dirty code. For example, when writing a simple utility, it's just tedious writing all the error handling code. With D, you can just let the default error handling mechanism deal with it. Int ranges are a good idea, but as an optional specification.
Aug 26 2001