D - std.compiler.Vendor
- Matthew (6/6) Mar 26 2004 This seems like a mistake.
- Walter (8/14) Mar 26 2004 I recommend they use their trademarked name, which legitimate vendors tr...
- Matthew (6/21) Mar 26 2004 to
- Walter (4/22) Mar 26 2004 try
- Vathix (13/46) Mar 26 2004 I think he means this:
- Walter (5/49) Mar 26 2004 the
- Ben Hinkle (28/43) Mar 27 2004 There should at least be an "unknown" vendor enum value so that a new
- Raiko (5/57) Mar 27 2004 It's a really bad idea to expect any business to cooperate with
- Walter (7/34) Mar 27 2004 That's a good idea, but I think having a two level set of names is a bit
- larry cowan (12/49) Mar 27 2004 There seems to be some confusion here in some of the posts. This is a l...
- Ben Hinkle (10/40) Mar 29 2004 I'm not sure what you mean by two level... The enum is alreay
- Walter (3/10) Mar 29 2004 Having the string as an alternate is probably a good idea.
- Hauke Duden (6/14) Mar 29 2004 So then you have a string that works always and an enum value that you
- J Anderson (9/16) Mar 30 2004 Using enum would help prevent bloat and is more efficient then string in...
- Hauke Duden (7/16) Mar 30 2004 Do you seriously consider one static string for the compiler vendor
- J Anderson (7/10) Mar 30 2004 But this can't be optimised out. ie you couldn't use the version
- J Anderson (6/15) Mar 30 2004 On the other hand, I guess if strings were constants then there's a
- Matthew (4/25) Mar 30 2004 If you need to avoid bloat, but require absolute uniqueness, a UUID is t...
- J C Calvarese (9/23) Mar 29 2004 Perhaps I'm missing the point of this thread, but it seems to me that
- Matthew (6/43) Mar 30 2004 That totally chews.
- J Anderson (13/28) Mar 31 2004 Why does vendorVersion have to be a string? Can't it be a number or a
- J Anderson (11/40) Mar 31 2004 Actually you could probably have:
This seems like a mistake. It would require any new vendor(s) to contact all existing vendors to coordinate on a new number? What if the other vendors are out for the day/week/month, or are playing tricky practices? Better not to rely on this, but rather have a number based on a UUID, or a domain name. (All vendors are going to have a domain name, aren't they?)
Mar 26 2004
"Matthew" <matthew stlsoft.org> wrote in message news:c40tfj$1ds2$1 digitaldaemon.com...This seems like a mistake. It would require any new vendor(s) to contact all existing vendors to coordinate on a new number? What if the other vendors are out for the day/week/month, or are playing tricky practices?I recommend they use their trademarked name, which legitimate vendors try to make as unique and unconfusing as possible. There's nothing really stopping one vendor from masquerading as another, but they will probably earn the condemnation of the D user community for doing so.Better not to rely on this, but rather have a number based on a UUID, or a domain name. (All vendors are going to have a domain name, aren't they?)UUID's are fine for computers, but are very unfriendly to type in. Domain names tend to be trademarked names.
Mar 26 2004
"Walter" <walter digitalmars.com> wrote in message news:c41p0k$2ps1$1 digitaldaemon.com..."Matthew" <matthew stlsoft.org> wrote in message news:c40tfj$1ds2$1 digitaldaemon.com...toThis seems like a mistake. It would require any new vendor(s) to contact all existing vendors to coordinate on a new number? What if the other vendors are out for the day/week/month, or are playing tricky practices?I recommend they use their trademarked name, which legitimate vendors trymake as unique and unconfusing as possible. There's nothing reallystoppingone vendor from masquerading as another, but they will probably earn the condemnation of the D user community for doing so.How can anyone use a name in an enum?aBetter not to rely on this, but rather have a number based on a UUID, ordomain name. (All vendors are going to have a domain name, aren't they?)UUID's are fine for computers, but are very unfriendly to type in. Domain names tend to be trademarked names.
Mar 26 2004
"Matthew" <matthew stlsoft.org> wrote in message news:c4236o$a3o$1 digitaldaemon.com..."Walter" <walter digitalmars.com> wrote in message news:c41p0k$2ps1$1 digitaldaemon.com...try"Matthew" <matthew stlsoft.org> wrote in message news:c40tfj$1ds2$1 digitaldaemon.com...This seems like a mistake. It would require any new vendor(s) to contact all existing vendors to coordinate on a new number? What if the other vendors are out for the day/week/month, or are playing tricky practices?I recommend they use their trademarked name, which legitimate vendorstoI don't understand what you mean.make as unique and unconfusing as possible. There's nothing reallystoppingone vendor from masquerading as another, but they will probably earn the condemnation of the D user community for doing so.How can anyone use a name in an enum?
Mar 26 2004
Walter wrote:"Matthew" <matthew stlsoft.org> wrote in message news:c4236o$a3o$1 digitaldaemon.com...I think he means this: // Master list of D compiler vendors enum Vendor { DigitalMars = 1 } // Which vendor we are Vendor vendor = Vendor.DigitalMars; Say I make a D compiler, I would have to tell all the other vendors to add me to the enum.. -- Christopher E. Miller"Walter" <walter digitalmars.com> wrote in message news:c41p0k$2ps1$1 digitaldaemon.com...try"Matthew" <matthew stlsoft.org> wrote in message news:c40tfj$1ds2$1 digitaldaemon.com...This seems like a mistake. It would require any new vendor(s) to contact all existing vendors to coordinate on a new number? What if the other vendors are out for the day/week/month, or are playing tricky practices?I recommend they use their trademarked name, which legitimate vendorstoI don't understand what you mean.make as unique and unconfusing as possible. There's nothing reallystoppingone vendor from masquerading as another, but they will probably earn the condemnation of the D user community for doing so.How can anyone use a name in an enum?
Mar 26 2004
"Vathix" <vathix dprogramming.com> wrote in message news:c42god$vp0$1 digitaldaemon.com...Walter wrote:the"Matthew" <matthew stlsoft.org> wrote in message news:c4236o$a3o$1 digitaldaemon.com..."Walter" <walter digitalmars.com> wrote in message news:c41p0k$2ps1$1 digitaldaemon.com...try"Matthew" <matthew stlsoft.org> wrote in message news:c40tfj$1ds2$1 digitaldaemon.com...This seems like a mistake. It would require any new vendor(s) to contact all existing vendors to coordinate on a new number? What if the other vendors are out for the day/week/month, or are playing tricky practices?I recommend they use their trademarked name, which legitimate vendorstomake as unique and unconfusing as possible. There's nothing reallystoppingone vendor from masquerading as another, but they will probably earnAh, I see now. I think the vendors would be willing to cooperate on this issue.I think he means this: // Master list of D compiler vendors enum Vendor { DigitalMars = 1 } // Which vendor we are Vendor vendor = Vendor.DigitalMars; Say I make a D compiler, I would have to tell all the other vendors to add me to the enum..I don't understand what you mean.condemnation of the D user community for doing so.How can anyone use a name in an enum?
Mar 26 2004
There should at least be an "unknown" vendor enum value so that a new vendor can ship before the next revision of phobos comes out with the "current vendor list". If the string vendor name is in there they why even have the enum? If the speed of doing a string compare is that important the user can cache the vendor value somewhere: int isDigitialMars = cmp(std.compiler.name,"Digital Mars D"); Let's say GDC comes out (not so hypothetical!). What does its compiler.d look like? If it has something like // Vendor specific string naming the compiler char[] name = "GNU D Compiler"; // Master list of D compiler vendors enum Vendor { DigitalMars = 1 GDC = 2; } Then in order for user code that references Vendor.GDC to compile you (meaning DMD) would need to make a release with that enum value. So whenever a new compiler comes out every other compiler needs to make a release with the new enum? hmmm. Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release. -BenI think he means this: // Master list of D compiler vendors enum Vendor { DigitalMars = 1 } // Which vendor we are Vendor vendor = Vendor.DigitalMars; Say I make a D compiler, I would have to tell all the other vendors to add me to the enum..Ah, I see now. I think the vendors would be willing to cooperate on this issue.
Mar 27 2004
It's a really bad idea to expect any business to cooperate with competition :). As was said, a string compare would work better because it doesn't rely on any cooperation. Ben Hinkle wrote:There should at least be an "unknown" vendor enum value so that a new vendor can ship before the next revision of phobos comes out with the "current vendor list". If the string vendor name is in there they why even have the enum? If the speed of doing a string compare is that important the user can cache the vendor value somewhere: int isDigitialMars = cmp(std.compiler.name,"Digital Mars D"); Let's say GDC comes out (not so hypothetical!). What does its compiler.d look like? If it has something like // Vendor specific string naming the compiler char[] name = "GNU D Compiler"; // Master list of D compiler vendors enum Vendor { DigitalMars = 1 GDC = 2; } Then in order for user code that references Vendor.GDC to compile you (meaning DMD) would need to make a release with that enum value. So whenever a new compiler comes out every other compiler needs to make a release with the new enum? hmmm. Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release. -BenI think he means this: // Master list of D compiler vendors enum Vendor { DigitalMars = 1 } // Which vendor we are Vendor vendor = Vendor.DigitalMars; Say I make a D compiler, I would have to tell all the other vendors to add me to the enum..Ah, I see now. I think the vendors would be willing to cooperate on this issue.
Mar 27 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:gtua60h5lcbj5lqtnb3as1rph0pfjgg642 4ax.com...There should at least be an "unknown" vendor enum value so that a new vendor can ship before the next revision of phobos comes out with the "current vendor list". If the string vendor name is in there they why even have the enum? If the speed of doing a string compare is that important the user can cache the vendor value somewhere: int isDigitialMars = cmp(std.compiler.name,"Digital Mars D");That's a good idea, but I think having a two level set of names is a bit klunky.Let's say GDC comes out (not so hypothetical!). What does its compiler.d look like? If it has something like // Vendor specific string naming the compiler char[] name = "GNU D Compiler"; // Master list of D compiler vendors enum Vendor { DigitalMars = 1 GDC = 2; } Then in order for user code that references Vendor.GDC to compile you (meaning DMD) would need to make a release with that enum value. So whenever a new compiler comes out every other compiler needs to make a release with the new enum? hmmm.Since it doesn't matter what the enum values are for various vendors, the customer can edit the compiler.d to put in any missing ones he needs.Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release.Having the version number separate is a good idea <g>.
Mar 27 2004
There seems to be some confusion here in some of the posts. This is a library module which can be overridden by your own as Walter suggests below. There never was any need for vendors to put out new versions of their compiler to keep up. If it's extended to include D software vendors in general, there are still a lot of options open since any new vendor could put an overriding version in their own release while they wait to be included in the standard module. There isn't in nearly all cases even any need for a non-vendor user to compile a modified version. This could however, if strings are used for everything and all software types vs each compiler are registered, become a rather huge module quickly. Enum of vendors and use of that for a support info matrix or for (in)compatibility vectors would help a lot. In article <c44knt$15kr$1 digitaldaemon.com>, Walter says..."Ben Hinkle" <bhinkle4 juno.com> wrote in message news:gtua60h5lcbj5lqtnb3as1rph0pfjgg642 4ax.com...There should at least be an "unknown" vendor enum value so that a new vendor can ship before the next revision of phobos comes out with the "current vendor list". If the string vendor name is in there they why even have the enum? If the speed of doing a string compare is that important the user can cache the vendor value somewhere: int isDigitialMars = cmp(std.compiler.name,"Digital Mars D");That's a good idea, but I think having a two level set of names is a bit klunky.Let's say GDC comes out (not so hypothetical!). What does its compiler.d look like? If it has something like // Vendor specific string naming the compiler char[] name = "GNU D Compiler"; // Master list of D compiler vendors enum Vendor { DigitalMars = 1 GDC = 2; } Then in order for user code that references Vendor.GDC to compile you (meaning DMD) would need to make a release with that enum value. So whenever a new compiler comes out every other compiler needs to make a release with the new enum? hmmm.Since it doesn't matter what the enum values are for various vendors, the customer can edit the compiler.d to put in any missing ones he needs.Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release.Having the version number separate is a good idea <g>.
Mar 27 2004
On Sat, 27 Mar 2004 11:22:05 -0800, "Walter" <walter digitalmars.com> wrote:"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:gtua60h5lcbj5lqtnb3as1rph0pfjgg642 4ax.com...I'm not sure what you mean by two level... The enum is alreay a redundant piece of information since the name should be a unique identifier.There should at least be an "unknown" vendor enum value so that a new vendor can ship before the next revision of phobos comes out with the "current vendor list". If the string vendor name is in there they why even have the enum? If the speed of doing a string compare is that important the user can cache the vendor value somewhere: int isDigitialMars = cmp(std.compiler.name,"Digital Mars D");That's a good idea, but I think having a two level set of names is a bit klunky.As a library writer I can either use the string to compare *or* I can rely on an enum value that I have to tell my users to add to the phobos library if they want my code to compile. Which is easier to use? I haven't ever needed to edit Microsoft's MSVC headers just to compile someone's code. It feels icky.Let's say GDC comes out (not so hypothetical!). What does its compiler.d look like? If it has something like // Vendor specific string naming the compiler char[] name = "GNU D Compiler"; // Master list of D compiler vendors enum Vendor { DigitalMars = 1 GDC = 2; } Then in order for user code that references Vendor.GDC to compile you (meaning DMD) would need to make a release with that enum value. So whenever a new compiler comes out every other compiler needs to make a release with the new enum? hmmm.Since it doesn't matter what the enum values are for various vendors, the customer can edit the compiler.d to put in any missing ones he needs.
Mar 29 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:htag605oeddmj0u62t14q9csophtfpltgb 4ax.com...Having the string as an alternate is probably a good idea.Since it doesn't matter what the enum values are for various vendors, the customer can edit the compiler.d to put in any missing ones he needs.As a library writer I can either use the string to compare *or* I can rely on an enum value that I have to tell my users to add to the phobos library if they want my code to compile. Which is easier to use? I haven't ever needed to edit Microsoft's MSVC headers just to compile someone's code. It feels icky.
Mar 29 2004
Walter wrote:So then you have a string that works always and an enum value that you sometimes have to hack to get it to work properly but that is intended to do the same thing. What's the sense in having the enum value, then? The string by itself is entirely sufficient!As a library writer I can either use the string to compare *or* I can rely on an enum value that I have to tell my users to add to the phobos library if they want my code to compile. Which is easier to use? I haven't ever needed to edit Microsoft's MSVC headers just to compile someone's code. It feels icky.Having the string as an alternate is probably a good idea.
Mar 29 2004
Hauke Duden wrote:Walter wrote:Using enum would help prevent bloat and is more efficient then string in the compiled executable. I'm thinking about openGL and it's extensions. Both enums (constants) and strings were used for slightly different purposes. Like in openGL, I think strings could be used for the dynamic/hardware side of things and enums for the constant vendor things, with some overlap. -- -Anderson: http://badmama.com.au/~anderson/Having the string as an alternate is probably a good idea.So then you have a string that works always and an enum value that you sometimes have to hack to get it to work properly but that is intended to do the same thing. What's the sense in having the enum value, then? The string by itself is entirely sufficient!
Mar 30 2004
J Anderson wrote:Do you seriously consider one static string for the compiler vendor "bloat"? It's a dozen or so bytes of overhead - if that is too much then any HLL is the wrong choice. Regarding the efficiency: you can compare the string once on startup and save the boolean (as someone else has already mentioned). HaukeSo then you have a string that works always and an enum value that you sometimes have to hack to get it to work properly but that is intended to do the same thing. What's the sense in having the enum value, then? The string by itself is entirely sufficient!Using enum would help prevent bloat and is more efficient then string in the compiled executable.
Mar 30 2004
Hauke Duden wrote:Regarding the efficiency: you can compare the string once on startup and save the boolean (as someone else has already mentioned). HaukeBut this can't be optimised out. ie you couldn't use the version statement (if statements can also be-optimised in this way), so therefore you still incur a run-time check. Therefore as I said, string for runtime and enums for compile time. -- -Anderson: http://badmama.com.au/~anderson/
Mar 30 2004
J Anderson wrote:Hauke Duden wrote:On the other hand, I guess if strings were constants then there's a chance they would be optimised out and you wouldn't need to do all that extra work your talking about. -- -Anderson: http://badmama.com.au/~anderson/Regarding the efficiency: you can compare the string once on startup and save the boolean (as someone else has already mentioned). HaukeBut this can't be optimised out. ie you couldn't use the version statement (if statements can also be-optimised in this way), so therefore you still incur a run-time check. Therefore as I said, string for runtime and enums for compile time.
Mar 30 2004
If you need to avoid bloat, but require absolute uniqueness, a UUID is the answer. "J Anderson" <REMOVEanderson badmama.com.au> wrote in message news:c4bhgn$2van$1 digitaldaemon.com...Hauke Duden wrote:Walter wrote:Using enum would help prevent bloat and is more efficient then string in the compiled executable. I'm thinking about openGL and it's extensions. Both enums (constants) and strings were used for slightly different purposes. Like in openGL, I think strings could be used for the dynamic/hardware side of things and enums for the constant vendor things, with some overlap. -- -Anderson: http://badmama.com.au/~anderson/Having the string as an alternate is probably a good idea.So then you have a string that works always and an enum value that you sometimes have to hack to get it to work properly but that is intended to do the same thing. What's the sense in having the enum value, then? The string by itself is entirely sufficient!
Mar 30 2004
Walter wrote:"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:htag605oeddmj0u62t14q9csophtfpltgb 4ax.com...Perhaps I'm missing the point of this thread, but it seems to me that requiring the vendor to do twice as much makes it half as likely that they'll get it right. I trust Ben and David; it's the multi-national corporations I'm wary of. I say keep the string. Drop the enum -- it's just another thing to go wrong. -- Justin http://jcc_7.tripod.com/d/Having the string as an alternate is probably a good idea.Since it doesn't matter what the enum values are for various vendors, the customer can edit the compiler.d to put in any missing ones he needs.As a library writer I can either use the string to compare *or* I can rely on an enum value that I have to tell my users to add to the phobos library if they want my code to compile. Which is easier to use? I haven't ever needed to edit Microsoft's MSVC headers just to compile someone's code. It feels icky.
Mar 29 2004
"Walter" <walter digitalmars.com> wrote in message news:c44knt$15kr$1 digitaldaemon.com..."Ben Hinkle" <bhinkle4 juno.com> wrote in message news:gtua60h5lcbj5lqtnb3as1rph0pfjgg642 4ax.com...That totally chews.There should at least be an "unknown" vendor enum value so that a new vendor can ship before the next revision of phobos comes out with the "current vendor list". If the string vendor name is in there they why even have the enum? If the speed of doing a string compare is that important the user can cache the vendor value somewhere: int isDigitialMars = cmp(std.compiler.name,"Digital Mars D");That's a good idea, but I think having a two level set of names is a bit klunky.Let's say GDC comes out (not so hypothetical!). What does its compiler.d look like? If it has something like // Vendor specific string naming the compiler char[] name = "GNU D Compiler"; // Master list of D compiler vendors enum Vendor { DigitalMars = 1 GDC = 2; } Then in order for user code that references Vendor.GDC to compile you (meaning DMD) would need to make a release with that enum value. So whenever a new compiler comes out every other compiler needs to make a release with the new enum? hmmm.Since it doesn't matter what the enum values are for various vendors, the customer can edit the compiler.d to put in any missing ones he needs.Why not have two strings - vendorName and vendorVersion. The former is free-form, but fixed from first use for a vendor, and the second has the fixed for "J.N.R" for maJor, miNor and Revision.Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release.Having the version number separate is a good idea <g>.
Mar 30 2004
Matthew wrote:Why does vendorVersion have to be a string? Can't it be a number or a struct of 4 (3) bytes? ie struct { byte J; byte N; byte R; byte O; //Other } Its easy to convert numbers to strings but not the other way round. -- -Anderson: http://badmama.com.au/~anderson/Why not have two strings - vendorName and vendorVersion. The former is free-form, but fixed from first use for a vendor, and the second has the fixed for "J.N.R" for maJor, miNor and Revision.Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release.Having the version number separate is a good idea <g>.
Mar 31 2004
J Anderson wrote:Matthew wrote:Actually you could probably have: struct versionNumber { byte J; byte N; byte R; byte O; //Other such as different flavours char [] toString {...} //Converts to dot format -- -Anderson: http://badmama.com.au/~anderson/Why does vendorVersion have to be a string? Can't it be a number or a struct of 4 (3) bytes? ie struct { byte J; byte N; byte R; byte O; //Other } Its easy to convert numbers to strings but not the other way round.Why not have two strings - vendorName and vendorVersion. The former is free-form, but fixed from first use for a vendor, and the second has the fixed for "J.N.R" for maJor, miNor and Revision.Just use the strings as unique identifiers. The biggest pain about using Java's System.getProperty("java.vendor") is that the strings have to include the version information in the string so it changes from release to release. Since std.compiler has version numbers as ints the string can remain constant from release to release.Having the version number separate is a good idea <g>.
Mar 31 2004