www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - LDC predefined identifiers

reply Brad Roberts <braddr puremagic.com> writes:
I'm in the process of updating the version.html list of predefined identifiers.
 I'd like to include the identifiers that are produced by LDC as well as
validate that there aren't conflicts or contradictions between the compilers.  I
know there was a thread about this a while back.  What's the current state for
LDC?

See also: http://d.puremagic.com/issues/show_bug.cgi?id=2994

The ddoc file, with some not yet committed edits:

        $(TABLE2 Compiler Vendors
        $(TR $(TH Identifier) $(TH Description))
        $(TR $(TD $(B DigitalMars)) $(TD Digital Mars compilers))
        )

        $(TABLE2 CPU Architectures
        $(TR $(TH Identifier) $(TH Description))
        $(TR $(TD $(B X86)) $(TD Intel and AMD 32 bit processors))
        $(TR $(TD $(B X86_64)) $(TD AMD and Intel 64 bit processors))
        )

        $(TABLE2 Operating Systems
        $(TR $(TH Identifier) $(TH Description))
        $(V2 $(TR $(TD $(B FreeBSD)) $(TD All Linux systems)))
        $(TR $(TD $(B linux)) $(TD All linux systems))
        $(V2 $(TR $(TD $(B Posix)) $(TD All posix systems)))
        $(V2 $(TR $(TD $(B Solaris)) $(TD All Solaris systems)))
        $(TR $(TD $(B Windows)) $(TD Microsoft Windows systems))
        $(TR $(TD $(B Win32)) $(TD Microsoft 32 bit Windows systems))
        $(TR $(TD $(B Win64)) $(TD Microsoft 64 bit Windows systems))
        )

        $(TABLE2 Various features
        $(TR $(TH Identifier) $(TH Description))
        $(TR $(TD $(B LittleEndian)) $(TD Byte order, least significant first))
        $(TR $(TD $(B BigEndian)) $(TD Byte order, most significant first))
        $(TR $(TD $(B D_Coverage)) $(TD $(LINK2 code_coverage.html, Code
coverage analysis) instrumentation (command line $(LINK2
dmd-windows.html#switches, switch) $(B -cov)) is being generated))
        $(TR $(TD $(B D_Ddoc)) $(TD $(LINK2 ddoc.html, Ddoc) documentation
(command line $(LINK2 dmd-windows.html#switches, switch) $(B -D)) is being
generated))
        $(TR $(TD $(B D_InlineAsm_X86)) $(TD $(LINK2 iasm.html, Inline
assembler) for X86 is implemented))
        $(TR $(TD $(B D_InlineAsm_X86_64)) $(TD $(LINK2 iasm.html, Inline
assembler) for X86-64 is implemented))
        $(V2 $(TR $(TD $(B D_NET)) $(TD The .NET D compiler)))
        $(TR $(TD $(B D_LP64)) $(TD Pointers are 64 bits (command line $(LINK2
dmd-windows.html#switches, switch) $(B -m64))))
        $(TR $(TD $(B D_PIC)) $(TD Position Independent Code (command line
$(LINK2 dmd-windows.html#switches, switch) $(B -fPIC)) is being generated))
        $(V2 $(TR $(TD $(B unittest)) $(TD Unit tests are enabled (command line
$(LINK2 dmd-windows.html#switches, switch) $(B -unittest)))))
        $(V2 $(TR $(TD $(B D_Version2)) $(TD This is a D version 2 compiler)))
        $(TR $(TD $(B none)) $(TD Never defined; used to just disable a section
of code))
        $(TR $(TD $(B all)) $(TD Always defined; used as the opposite of $(B
none)))
        )

Thanks,
Brad
Jun 07 2009
parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Brad Roberts wrote:
 I'm in the process of updating the version.html list of predefined identifiers.
  I'd like to include the identifiers that are produced by LDC as well as
 validate that there aren't conflicts or contradictions between the compilers. 
I
 know there was a thread about this a while back.  What's the current state for
LDC?
Just search for "addPredefinedGlobalIdent" on this page: http://www.dsource.org/projects/ldc/browser/gen/main.cpp
Jun 07 2009
parent reply Brad Roberts <braddr puremagic.com> writes:
Frits van Bommel wrote:
 Brad Roberts wrote:
 I'm in the process of updating the version.html list of predefined
 identifiers.
  I'd like to include the identifiers that are produced by LDC as well as
 validate that there aren't conflicts or contradictions between the
 compilers.  I
 know there was a thread about this a while back.  What's the current
 state for LDC?
Just search for "addPredefinedGlobalIdent" on this page: http://www.dsource.org/projects/ldc/browser/gen/main.cpp
Thanks. I've added them. I'm not particularly excited about the way this looks, but take a peek: http://www.puremagic.com/~braddr/phobos-trunk/2.0/version.html#PredefinedVersions Thanks, Brad
Jun 07 2009
next sibling parent reply Christian Kamm <kamm-incasoftware removethis.de> writes:
Brad Roberts wrote:
 Thanks.  I've added them.  I'm not particularly excited about the way this
 looks, but take a peek:
 
 http://www.puremagic.com/~braddr/phobos-
trunk/2.0/version.html#PredefinedVersions Looks good to me. You've missed darwin (ldc only) though, while OSX works on both ldc and dmd. Shouldn't X86_64 and D_InlineAsm_X86_64 also be ldc only? I couldn't find it in gdc's documentation, but I think it uses freebsd, darwin and solaris and does not support the capitalized identifiers. By the way, a neater list of ldc's version identifiers is available at http://www.dsource.org/projects/ldc/wiki/Docs#Versions
Jun 07 2009
parent reply Brad Roberts <braddr puremagic.com> writes:
Christian Kamm wrote:
 Brad Roberts wrote:
 Thanks.  I've added them.  I'm not particularly excited about the way this
 looks, but take a peek:

 http://www.puremagic.com/~braddr/phobos-
trunk/2.0/version.html#PredefinedVersions Looks good to me. You've missed darwin (ldc only) though, while OSX works on both ldc and dmd. Shouldn't X86_64 and D_InlineAsm_X86_64 also be ldc only?
Fixed.
 I couldn't find it in gdc's documentation, but I think it uses freebsd, 
 darwin and solaris and does not support the capitalized identifiers.
I opted to ignore GDC as it's update rate for way too many years has been all but zilch. I'd love to see it alive and kicking and re-joining the ranks of D compilers.. and if it does, then we can re-address the list then. I'm concerned at the differences just between dmd and ldc. The multiple capitalizations are just going to cause grief if/when people use the ones that are ldc specific. I'm also open to suggestions on how to better manage the last block. It's a bit of a mismash of random identifiers.
 By the way, a neater list of ldc's version identifiers is available at
 http://www.dsource.org/projects/ldc/wiki/Docs#Versions
I liked the use of the src, it wass more likely to be accurate. :) Walter, any objection to me submitting the changes to version.dd or would you prefer that I send you a patch to look at first? Later, Brad
Jun 07 2009
parent reply Robert Clipsham <robert octarineparrot.com> writes:
Brad Roberts wrote:
 Christian Kamm wrote:
 Brad Roberts wrote:
 Thanks.  I've added them.  I'm not particularly excited about the way this
 looks, but take a peek:

 http://www.puremagic.com/~braddr/phobos-
trunk/2.0/version.html#PredefinedVersions Looks good to me. You've missed darwin (ldc only) though, while OSX works on both ldc and dmd. Shouldn't X86_64 and D_InlineAsm_X86_64 also be ldc only?
Fixed.
 I couldn't find it in gdc's documentation, but I think it uses freebsd, 
 darwin and solaris and does not support the capitalized identifiers.
I opted to ignore GDC as it's update rate for way too many years has been all but zilch. I'd love to see it alive and kicking and re-joining the ranks of D compilers.. and if it does, then we can re-address the list then. I'm concerned at the differences just between dmd and ldc. The multiple capitalizations are just going to cause grief if/when people use the ones that are ldc specific. I'm also open to suggestions on how to better manage the last block. It's a bit of a mismash of random identifiers.
 By the way, a neater list of ldc's version identifiers is available at
 http://www.dsource.org/projects/ldc/wiki/Docs#Versions
I liked the use of the src, it wass more likely to be accurate. :) Walter, any objection to me submitting the changes to version.dd or would you prefer that I send you a patch to look at first? Later, Brad
Dunno if anyone else thinks this, but the operating system looks very confusing with all the LDC only identifiers mixed in. I think it'd be a good idea to find out which of them are "deprecated" and remove them, eg only keeping one of either solaris or Solaris etc.
Jun 08 2009
parent reply Robert Fraser <fraserofthenight gmail.com> writes:
Robert Clipsham wrote:
 Dunno if anyone else thinks this, but the operating system looks very 
 confusing with all the LDC only identifiers mixed in. I think it'd be a 
 good idea to find out which of them are "deprecated" and remove them, eg 
 only keeping one of either solaris or Solaris etc.
Neither side seems to want to budge on this (rather pointless, IMO) matter. LDC chose the identifiers first. Then DMD got support for Solaris, FreeBSD, and OSX, and chose different identifiers. LDC added DMD's but decided not to deprecate their own (probably because they were already in use in Tango). I also wonder why there's a Win32 and a Win64... I don't see a Linux64, so why is Windows so special? I know Win32 has been around in D for a while, but in that case, WIn32 should be defined even on 64-bit Windows targets for compatibility reasons (like %WINDIR%/System32 is kept as System32 even on 64-bit platforms).
Jun 08 2009
parent Christian Kamm <kamm-incasoftware removethis.de> writes:
Robert Fraser wrote:

 Robert Clipsham wrote:
 Dunno if anyone else thinks this, but the operating system looks very
 confusing with all the LDC only identifiers mixed in. I think it'd be a
 good idea to find out which of them are "deprecated" and remove them, eg
 only keeping one of either solaris or Solaris etc.
Neither side seems to want to budge on this (rather pointless, IMO) matter. LDC chose the identifiers first. Then DMD got support for Solaris, FreeBSD, and OSX, and chose different identifiers. LDC added DMD's but decided not to deprecate their own (probably because they were already in use in Tango).
The problem with removing one set of duplicates is that it introduces an incompatibility with either DMD or GDC. I've adjusted the LDC documentation to recommend Walter's identifiers; the last discussion was unable to convince him to change them and I'd guess it's the one with more users.
Jun 08 2009
prev sibling next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Brad Roberts:
 I'm not particularly excited about the way this looks, but take a peek:<
I can see names like: LDC LLVM LLVM64 Win64 Win32 Windows D_Version2 => They may become more orthogonal, and there's no need to keep both LDC and LLVM: Bit_64 Bit_32 Windows Linux Compiler_LDC Compiler_DMD Compiler_GDC Stdlib_Phobos Stdlib_Tango D_Version_1 D_Version_2 And some more. Bye, bearophile
Jun 08 2009
parent Brad Roberts <braddr puremagic.com> writes:
bearophile wrote:
 Brad Roberts:
 I'm not particularly excited about the way this looks, but take a peek:<
I can see names like: LDC LLVM LLVM64 Win64 Win32 Windows D_Version2 => They may become more orthogonal, and there's no need to keep both LDC and LLVM: Bit_64 Bit_32 Windows Linux Compiler_LDC Compiler_DMD Compiler_GDC Stdlib_Phobos Stdlib_Tango D_Version_1 D_Version_2 And some more. Bye, bearophile
My goal wasn't to start a complete overhaul of the identifiers. That'd cause way more grief than just creating the list for only a small amount of gain. Later, Brad
Jun 08 2009
prev sibling parent reply Leandro Lucarella <llucax gmail.com> writes:
Brad Roberts, el  7 de junio a las 18:53 me escribiste:
 Frits van Bommel wrote:
 Brad Roberts wrote:
 I'm in the process of updating the version.html list of predefined
 identifiers.
  I'd like to include the identifiers that are produced by LDC as well as
 validate that there aren't conflicts or contradictions between the
 compilers.  I
 know there was a thread about this a while back.  What's the current
 state for LDC?
Just search for "addPredefinedGlobalIdent" on this page: http://www.dsource.org/projects/ldc/browser/gen/main.cpp
Thanks. I've added them. I'm not particularly excited about the way this looks, but take a peek: http://www.puremagic.com/~braddr/phobos-trunk/2.0/version.html#PredefinedVersions
I'm wondering if it's ok to include compiler-specific switches into the specs, isn't that against an specification? I guess it's better just to list the "standard" identifiers only and let compiler documentation list compiler specific ones. I think the specs should be more and more compiler independent, not the other way around =) -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ----------------------------------------------------------------------------
Jun 08 2009
parent reply Brad Roberts <braddr puremagic.com> writes:
Leandro Lucarella wrote:
 Brad Roberts, el  7 de junio a las 18:53 me escribiste:
 Frits van Bommel wrote:
 Brad Roberts wrote:
 I'm in the process of updating the version.html list of predefined
 identifiers.
  I'd like to include the identifiers that are produced by LDC as well as
 validate that there aren't conflicts or contradictions between the
 compilers.  I
 know there was a thread about this a while back.  What's the current
 state for LDC?
Just search for "addPredefinedGlobalIdent" on this page: http://www.dsource.org/projects/ldc/browser/gen/main.cpp
Thanks. I've added them. I'm not particularly excited about the way this looks, but take a peek: http://www.puremagic.com/~braddr/phobos-trunk/2.0/version.html#PredefinedVersions
I'm wondering if it's ok to include compiler-specific switches into the specs, isn't that against an specification? I guess it's better just to list the "standard" identifiers only and let compiler documentation list compiler specific ones. I think the specs should be more and more compiler independent, not the other way around =)
I'm fine with dropping parts, this was a starting point. On the table to drop from the docs: 1) the entire Compiler Vendors block 2) darwin 3) freebsd 4) mingw32 ? 5) solaris More? Less? My goal is to document what users should know about being able to write code that will work with any D compiler. Calling out the differences highlights problem areas that exist today. It's _ok_ that the predefined version identifiers don't line up 100%, that's to be expected due to differences that don't cause grief. For example, the cpu architecture differences and the 32 vs 64 bit differences. What's not ok is solaris vs Solaris (for example). That just adds confusion. I'm not going to be the guy to decide which is right.. the ldc developers and walter can yell at each other until one caves. But, please, one side cave so there's just one. Later, Brad
Jun 08 2009
parent Leandro Lucarella <llucax gmail.com> writes:
Brad Roberts, el  8 de junio a las 09:19 me escribiste:
 Leandro Lucarella wrote:
 Brad Roberts, el  7 de junio a las 18:53 me escribiste:
 Frits van Bommel wrote:
 Brad Roberts wrote:
 I'm in the process of updating the version.html list of predefined
 identifiers.
  I'd like to include the identifiers that are produced by LDC as well as
 validate that there aren't conflicts or contradictions between the
 compilers.  I
 know there was a thread about this a while back.  What's the current
 state for LDC?
Just search for "addPredefinedGlobalIdent" on this page: http://www.dsource.org/projects/ldc/browser/gen/main.cpp
Thanks. I've added them. I'm not particularly excited about the way this looks, but take a peek: http://www.puremagic.com/~braddr/phobos-trunk/2.0/version.html#PredefinedVersions
I'm wondering if it's ok to include compiler-specific switches into the specs, isn't that against an specification? I guess it's better just to list the "standard" identifiers only and let compiler documentation list compiler specific ones. I think the specs should be more and more compiler independent, not the other way around =)
I'm fine with dropping parts, this was a starting point.
Ok
 On the table to drop from the docs:
 
 1) the entire Compiler Vendors block
 2) darwin
 3) freebsd
 4) mingw32 ?
 5) solaris
 
 More?  Less?
I'm not sure about mingw32 either, but I think it's not used in LDC anymore (at least I saw some commits that replaced the use of mingw32 with Windows). I'll remove LLVM64 too, the Notes column (at least the current notes about "XXX only") and comments about command line switches (unless the command-line interface for the compiler is "standarized" too, which can be nice but I don't know if that's the case).
 My goal is to document what users should know about being able to write code
 that will work with any D compiler.  Calling out the differences highlights
 problem areas that exist today.
 
 It's _ok_ that the predefined version identifiers don't line up 100%, that's to
 be expected due to differences that don't cause grief.  For example, the cpu
 architecture differences and the 32 vs 64 bit differences.
 
 What's not ok is solaris vs Solaris (for example).  That just adds confusion.
 I'm not going to be the guy to decide which is right.. the ldc developers and
 walter can yell at each other until one caves.  But, please, one side cave so
 there's just one.
Agreed. LDC support both, but having one of the flavors deprecated and one officially supported (I mean, defined by the specs) should be ideal. It would be *very* nice to have a consistent case for identifiers too (please, don't stick to linux if all other identifiers are capitalized, make Linux the official one and have the old as a deprecated identifier). -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ----------------------------------------------------------------------------
Jun 08 2009