April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to cemiller | cemiller wrote:
> How about just making version and debug identifiers case-insensitive? Aren't they already in their own special namespace; they're special-case (pun intended).
Because then I have to explain why some identifiers are case sensitive and some or not for the next few decades. <g>
|
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Wed, Apr 15, 2009 at 2:19 AM, Walter Bright <newshound1@digitalmars.com> wrote: > Tomas Lindquist Olsen wrote: >> >> After reading more, I just can't help but feel this is wrong. >> >> linux is still the only version identifier following this "logic". >> >> Comparing http://predef.sourceforge.net/preos.html and D: >> >> linux -> linux >> _WIN32 -> Win32 >> _WIN64 -> Win64 > > Microsoft predefines _WIN32 for Windows 64, too! > D: > Windows: All members of the Windows family > Win32: specific to Windows 32 > Win64: specific to Windows 64 > That seems sensible to me. Agreed! > >> __FreeBSD__ -> FreeBSD > > The __ are ugly but necessary because of the C standard, but they are ugly and *unnecessary* for D. Agreed! > >> __APPLE__ or __MACH__ -> OSX > > Apple has made many operating systems besides OSX, so __APPLE__ is out. I can't even remember which OS Mach is. According to the site I linked __MACH__ and __APPLE__ are both for OSX, I guess that might be wrong, I've never really had to code for OSX. Still Apple call it "Mac OS X" so one could argue that "MacOSX" is a better identifier. > >> Even if you strip underscores, OSX and Win32/64 still don't match C/C++ identifiers. Why should linux be special? > > Because the gcc macro suits the need perfectly. The others don't. I simply don't agree here. To me, linux (as opposed to Linux) is a special case that I need to remember, the others follow a pattern. > >> I realise this is a minor thing probably not worth the time it gets, but D seems to have a tendency to throw in inconsistencies in every crack there is to find ... > > If gcc had any consistency, I'd use that. But it doesn't. It makes sense to use gcc's precedent when gcc makes sense, and to diverge when gcc does not make sense. > Maybe it makes sense to you. Not to me. |
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Tue, 14 Apr 2009 15:49:02 -0400, Walter Bright <newshound1@digitalmars.com> wrote: > Tomas Lindquist Olsen wrote: >> And if not, why is there no Linux ? This is the obvious reason for >> GDC/LDC pick the lowercase identifiers in the first place ... > > Because gcc on linux predefines "linux", not "Linux". Just so you know this argument is flawed. Although you are in your right to select the identifier, you have based it on invalid logic. First, nobody can directly compile C code under D, especially with preprocessor logic. So right there, you already must change the code. Now, since you must change the code (and most places that are cross platform don't have simple #ifdef __linux, so global search/replace is no good), you have plenty of opportunity to change the identifier from __linux or linux to Linux. Next, you are inconsistent with other platforms. Windows Defines _WIN32, yet you use Win32, shouldn't you use WIN32 to be consistent with capitalization? You are selectively applying reasoning to justify inconsistent naming techniques. Just say "Because I'm Walter and I said so" and call it a day, or change it to the way it should be. Take the identifier name from where you want, but make the capitalization consistent. We have no legacy requirements here (read: D compiler does not have to compile C preprocessor code, I know there's lots of D code with version(linux) already, but now is the time to make a change, not later), and to make things not follow a consistent capitalization scheme makes it look like an error in the code. version(FreeBSD) version=v1; version(OSX) version=v2; version(Win32) version=v3; version(linux) version=v4; // huh? oh, the author must have made a capitalization error. If you need another reason, linux looks like 1inux in some fonts ;) BTW, when I started writing D code for multi-platform, I instinctively used version(Linux), but found out that was wrong by trial and error. -Steve |
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 2009-04-14 17:56:51 -0400, Walter Bright <newshound1@digitalmars.com> said: > Jacob Carlborg wrote: >> If you follow what's normally written in the official literature and documentation shouldn't it be "MacOSX" then? > > Perhaps. One could argue it either way. I checked the predefined identifiers in gcc for guidance, and found just the unfortunately generic __APPLE__. I wish Apple would make up their mind what they wanted to call their OS. To me it's clear that Darwin is the core on which Mac OS X and iPhone OS are based on. Mac OS X looks like a marketing name to me; I wouldn't be surprised if in a few years it gets renamed to Mac OS XI, or something else, because Mac OS X 10.10 would sound bad, just as would Mac OS X 11. Perhaps we'll see Mac OS 11, iOS or something; whatever the change, the "X" part will have to move out at some point. I believe Darwin is a more stable identifier for the architecture than Mac OS X. But I also agree with Walter that it's probably not something a newbie to programming and/or the platform would expect. In the end, I think I'd choose Darwin because you want the identifier to represent the OS architecture, not all the higher-level features Apple has layered on top of it, and because most people interested in writing cross-patform code using Darwin/OSX-specific features will already know about Darwin. -- Michel Fortin michel.fortin@michelf.com http://michelf.com/ |
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Tue, 14 Apr 2009 12:49:02 -0700, Walter Bright wrote:
> Tomas Lindquist Olsen wrote:
>> And if not, why is there no Linux ? This is the obvious reason for GDC/LDC pick the lowercase identifiers in the first place ...
>
> Because gcc on linux predefines "linux", not "Linux".
The way gcc does it looks like a historic legacy to me.
Ported code is ported - no reasonable programmer will just remove __
and go for it.
Let's focus on practical means and consistency.
|
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > cemiller wrote: >> How about just making version and debug identifiers case-insensitive? Aren't they already in their own special namespace; they're special-case (pun intended). > > Because then I have to explain why some identifiers are case sensitive and some or not for the next few decades. <g> Currently, you'll have to explain why one identifier is lowercase while the others are mixed case for the next few decades. I thought one of the big strengths of D was dropping compatibility where it made sense and improved things. No one is going to be copy+pasting C code into D complete with #ifdef's and expecting it to work. Aside from that, which of the following is easier to explain to programmers? "Platform version identifiers are mixed case and named for the consumer name of the platform. API version identifiers follow the same rule." "Platform version identifiers may be any case and are sometimes named after the identifier used in that platform's C compiler, possibly changed to remove underscores, unless we didn't like that identifier in which case we might be using another one. This made up one could be the name of the platform, the name of the OS, or something else." -- Daniel |
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michel Fortin | On Tue, Apr 14, 2009 at 10:41 PM, Michel Fortin <michel.fortin@michelf.com> wrote:
> To me it's clear that Darwin is the core on which Mac OS X and iPhone OS are based on. Mac OS X looks like a marketing name to me; I wouldn't be surprised if in a few years it gets renamed to Mac OS XI, or something else, because Mac OS X 10.10 would sound bad, just as would Mac OS X 11. Perhaps we'll see Mac OS 11, iOS or something; whatever the change, the "X" part will have to move out at some point.
>
> I believe Darwin is a more stable identifier for the architecture than Mac OS X.
Out of all the arguments put forth so far, I think this is the
strongest. OSX is just the name of Apple's 10th Mac OS. Why would we
have version(OSX), but not version(WinXP), version(WinVista),
version(LinuxUbuntuGutsy) etc. etc. etc.?
|
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Koroskin | Denis Koroskin wrote: > I also wonder why it is OSX. Are versions prior to MacOS 10 (which is marketed as MacOS X) officially unsupported by D? All versions before Mac OS X 10.4 are "unsupported", even though you can make Mac OS X 10.3 limp along with an older GDC version*. Mac OS 9 is flat out, due to having the "wrong" processor (PPC) and no recent GCC. Oh, and the fact that it is also quite dead. --anders * http://prdownloads.sourceforge.net/gdcmac/gdc-0.21-mac-10.3.dmg |
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > Jacob Carlborg wrote: >> It depends on what documentation you read. http://developer.apple.com/documentation/Darwin/index.html >> In this documentation "Darwin" is all over the place. > > Move up a directory, and it's OSX, OSX, OSX. I can only seem to find "Mac OS X", not "OSX" ? But the site _is_ divided into two OS sections, Mac OS X and iPhone OS, both of which are "OSX". (and also based on Darwin, e.g. what uname says) For instance wxWidgets is also using it: wxOSX*. * http://wiki.wxwidgets.org/Development:_wxMac with wxOSX_CARBON, wxOSX_COCOA, wxOSX_IPHONE So I suppose one can use "OSX" instead of "darwin". --anders |
April 15, 2009 Re: dmd 1.043 alpha for FreeBSD 7.1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote: > Michel Fortin wrote: >> To me it's clear that Darwin is the core on which Mac OS X and iPhone OS are >> based on. Mac OS X looks like a marketing name to me; I wouldn't be >> surprised if in a few years it gets renamed to Mac OS XI, or something else, >> because Mac OS X 10.10 would sound bad, just as would Mac OS X 11. Perhaps >> we'll see Mac OS 11, iOS or something; whatever the change, the "X" part >> will have to move out at some point. It's also possible that "Mac OS X" stays in, while Darwin changes... This already happened once before, to "Mac OS X Server" and Rhapsody. >> I believe Darwin is a more stable identifier for the architecture than Mac >> OS X. > > Out of all the arguments put forth so far, I think this is the > strongest. OSX is just the name of Apple's 10th Mac OS. Why would we > have version(OSX), but not version(WinXP), version(WinVista), > version(LinuxUbuntuGutsy) etc. etc. etc.? It would be more like version(NT), if you want to compare with Windows ? GNU/Linux operating system versioning is a long sad story all by itself. --anders |
Copyright © 1999-2021 by the D Language Foundation