digitalmars.D.learn - Why is Linux the only OS in version identifier list that has a
- Zekereth (11/11) Apr 10 2016 So I was just testing some code and couldn't figure out why it
- Mike Parker (8/17) Apr 10 2016 It's an artifact of history. When this was first introduced,
- Zekereth (3/11) Apr 10 2016 Thanks, that makes sense. It would be nice if Linux could be
- =?UTF-8?Q?Ali_=c3=87ehreli?= (11/22) Apr 10 2016 As a workaround, you can set version to Linux yourself:
- Zekereth (2/12) Apr 10 2016 That's interesting that will help. Thanks for that!
- Steven Schveighoffer (7/21) Apr 12 2016 I highly recommend not to do this. New version assignments do not live
- marcpmichel (2/4) Apr 11 2016 Is it because Linux is not an OS ? :p
- Brian Schott (2/3) Apr 11 2016 I gnu somebody would bring that up.
- Zekereth (2/5) Apr 11 2016 /sigh so did I.
- Joseph Rushton Wakeling (9/12) Apr 12 2016 There's actually a serious point here, though -- as D is ported
- Jonathan M Davis via Digitalmars-d-learn (8/21) Apr 12 2016 Well, work has been done to make it so that different runtimes will work...
- Joseph Rushton Wakeling (6/12) Apr 12 2016 That's pretty cool. Was that a result of the recent Android
- Jonathan M Davis via Digitalmars-d-learn (11/24) Apr 12 2016 I believe that some of the LDC guys in particular (and maybe GDC guys to...
So I was just testing some code and couldn't figure out why it wasn't working. My version block looked like this: version(Linux) { ... } Looking at the list(unless I'm missing something) Linux is the only OS that is lowercase. I'm guessing most people use Posix instead and never encounter this problem. Regard, Zekereth
Apr 10 2016
On Sunday, 10 April 2016 at 22:03:54 UTC, Zekereth wrote:So I was just testing some code and couldn't figure out why it wasn't working. My version block looked like this: version(Linux) { ... } Looking at the list(unless I'm missing something) Linux is the only OS that is lowercase. I'm guessing most people use Posix instead and never encounter this problem.It's an artifact of history. When this was first introduced, Walter's intent was to match the casing used in gcc preprocessor definitions. Since that time, we've standardized on capitalization for everything, but 'linux' lives on. I would like to see 'Linux' introduced for consistency and to avoid errors like yours (a bug lived in Phobos for a long time because of this) while maintaining 'linux' for backwards compatibility.
Apr 10 2016
On Monday, 11 April 2016 at 00:51:19 UTC, Mike Parker wrote:It's an artifact of history. When this was first introduced, Walter's intent was to match the casing used in gcc preprocessor definitions. Since that time, we've standardized on capitalization for everything, but 'linux' lives on. I would like to see 'Linux' introduced for consistency and to avoid errors like yours (a bug lived in Phobos for a long time because of this) while maintaining 'linux' for backwards compatibility.Thanks, that makes sense. It would be nice if Linux could be introduced. I'll just have to remember from now on. Thanks again!
Apr 10 2016
On 04/10/2016 03:03 PM, Zekereth wrote:So I was just testing some code and couldn't figure out why it wasn't working. My version block looked like this: version(Linux) { ... } Looking at the list(unless I'm missing something) Linux is the only OS that is lowercase. I'm guessing most people use Posix instead and never encounter this problem. Regard, ZekerethAs a workaround, you can set version to Linux yourself: version (linux) { version = Linux; } void main() { version (Linux) { import std.stdio; writeln("Linux worked!"); } }
Apr 10 2016
On Monday, 11 April 2016 at 01:15:27 UTC, Ali Çehreli wrote:As a workaround, you can set version to Linux yourself: version (linux) { version = Linux; } void main() { version (Linux) { import std.stdio; writeln("Linux worked!"); } }That's interesting that will help. Thanks for that!
Apr 10 2016
On 4/10/16 9:19 PM, Zekereth wrote:On Monday, 11 April 2016 at 01:15:27 UTC, Ali Çehreli wrote:I highly recommend not to do this. New version assignments do not live outside the module, so you have to do this in EVERY module you want to use it. Better to pass on the command line. Even better to just use the standard version identifier :) -SteveAs a workaround, you can set version to Linux yourself: version (linux) { version = Linux; } void main() { version (Linux) { import std.stdio; writeln("Linux worked!"); } }That's interesting that will help. Thanks for that!
Apr 12 2016
On Sunday, 10 April 2016 at 22:03:54 UTC, Zekereth wrote:Looking at the list(unless I'm missing something) Linux is the only OS that is lowercase.Is it because Linux is not an OS ? :p
Apr 11 2016
On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote:Is it because Linux is not an OS ? :pI gnu somebody would bring that up.
Apr 11 2016
On Tuesday, 12 April 2016 at 01:32:02 UTC, Brian Schott wrote:On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote:/sigh so did I.Is it because Linux is not an OS ? :pI gnu somebody would bring that up.
Apr 11 2016
On Tuesday, 12 April 2016 at 01:32:02 UTC, Brian Schott wrote:On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote:There's actually a serious point here, though -- as D is ported to other platforms and architectures, it's going to wind up being used to target environments that use a Linux kernel but are not GNU. Conversely, there may also be systems that are GNU but not Linux (e.g. the recent proposal for an Ubuntu flavour based on the FreeBSD kernel). Are druntime and phobos ready to deal with those kinds of eventuality?Is it because Linux is not an OS ? :pI gnu somebody would bring that up.
Apr 12 2016
On Tuesday, April 12, 2016 17:22:05 Joseph Rushton Wakeling via Digitalmars-d- learn wrote:On Tuesday, 12 April 2016 at 01:32:02 UTC, Brian Schott wrote:Well, work has been done to make it so that different runtimes will work - e.g. there's a CRuntime_Glibc and a CRuntime_Bionic. So, druntime is a lot better off than just linux vs FreeBSD vs whatever. But it wouldn't surprise me in the least if someone using something like Debian GNU/kFreeBSD would find some problems with what we currently have. - Jonathan M DavisOn Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote:There's actually a serious point here, though -- as D is ported to other platforms and architectures, it's going to wind up being used to target environments that use a Linux kernel but are not GNU. Conversely, there may also be systems that are GNU but not Linux (e.g. the recent proposal for an Ubuntu flavour based on the FreeBSD kernel). Are druntime and phobos ready to deal with those kinds of eventuality?Is it because Linux is not an OS ? :pI gnu somebody would bring that up.
Apr 12 2016
On Tuesday, 12 April 2016 at 18:23:25 UTC, Jonathan M Davis wrote:Well, work has been done to make it so that different runtimes will work - e.g. there's a CRuntime_Glibc and a CRuntime_Bionic.That's pretty cool. Was that a result of the recent Android porting work, or was it a longer-standing division?So, druntime is a lot better off than just linux vs FreeBSD vs whatever. But it wouldn't surprise me in the least if someone using something like Debian GNU/kFreeBSD would find some problems with what we currently have.Ah, fun stuff :-) BTW, glad to see you will be making it to DConf -- looking forward to catching up with you!
Apr 12 2016
On Tuesday, April 12, 2016 19:15:33 Joseph Rushton Wakeling via Digitalmars-d- learn wrote:On Tuesday, 12 April 2016 at 18:23:25 UTC, Jonathan M Davis wrote:I believe that some of the LDC guys in particular (and maybe GDC guys too) have been adding stuff like that over time to support the various platforms that they support, though Bionic is specifically Android if I understand correctly, and I think that it was spurred adding the Glibc version specifically. IIRC, the other major divide like that is Digital Mars vs Microsoft for the Windows C runtime, and I think that the addition of 64-bit support to Windows is what ultimately spurred that one on.Well, work has been done to make it so that different runtimes will work - e.g. there's a CRuntime_Glibc and a CRuntime_Bionic.That's pretty cool. Was that a result of the recent Android porting work, or was it a longer-standing division?:) - Jonathan M DavisSo, druntime is a lot better off than just linux vs FreeBSD vs whatever. But it wouldn't surprise me in the least if someone using something like Debian GNU/kFreeBSD would find some problems with what we currently have.Ah, fun stuff :-) BTW, glad to see you will be making it to DConf -- looking forward to catching up with you!
Apr 12 2016