August 16, 2010
I have a fully compiling Windows version ready to test, but issue 3979 blocks that.  I didn't have the patience that Lars had to build it outside of phobos, so I just put it on hold for now :)  But yes, everything that std.process supports will be doable on both phobos and Windows with a common interface. There will be one minor difference -- Windows has a GUI flag that prevents a console window from appearing.  This is important to people who are running programs they don't want to pop up temporary console windows.

This flag simply won't be defined in POSIX.

-Steve



>
>From: David Simcha <dsimcha at gmail.com>
>To: Discuss the phobos library for D <phobos at puremagic.com>
>Sent: Mon, August 16, 2010 10:11:40 AM
>Subject: Re: [phobos] Removing std.stdio.File.popen()
>
>This looks terrific.  I've always found the old std.process to be way underpowered, especially on Windows.  Does your statement about cross-platformness imply that Windows will eventually be supported, too?
>
>
>On Mon, Aug 16, 2010 at 9:20 AM, Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
>
>On Mon, 2010-08-16 at 09:04 -0400, Adam Ruppe wrote:
>>> I actually use it (which is why I duplicated your bug), but am OK with
>>> removing it, since it is easy enough to get at anyway. For a while, I
>>> did a separate extern(C) for pclose anyway!
>>>
>>> However, I don't think something being POSIX only is a good reason to remove something. D should take advantages of whatever platform it is on. Portability is good when you can have it, but it shouldn't be a function killer alone.
>>
>>Two comments:
>>
>>1. I disagree with you. :)  I think that Phobos' user-visible interface should be completely platform agnostic.  Code that depends only on Phobos should compile and run on any platform.
>>
>>2. Steve and I have been working on a new version of std.process, which
>>will at some point, hopefully, obviate the need for popen().  See
>>pipeProcess() here:
>>
>> http://www.kyllingen.net/code/ltk/doc/process.html
>>
>>The POSIX implementation is more or less complete, but its inclusion in Phobos is currently being blocked by bug 3979.  Also, Steve has run into some very tricky issues with pipes on Windows, fundamentally caused by D's dependence on the DMC runtime.  I don't know how (or if) that is working out.
>>
>>-Lars
>>
>>
>>_______________________________________________
>>phobos mailing list
>>phobos at puremagic.com
>>http://lists.puremagic.com/mailman/listinfo/phobos
>>
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100816/d96e9900/attachment.html>
August 16, 2010
Does that mean you figured out the whole FILE* <--> HANDLE thing?  If so, that's awesome!

-Lars



On Mon, 2010-08-16 at 07:28 -0700, Steve Schveighoffer wrote:
> I have a fully compiling Windows version ready to test, but issue 3979 blocks that.  I didn't have the patience that Lars had to build it outside of phobos, so I just put it on hold for now :)  But yes, everything that std.process supports will be doable on both phobos and Windows with a common interface.  There will be one minor difference -- Windows has a GUI flag that prevents a console window from appearing.  This is important to people who are running programs they don't want to pop up temporary console windows.
> 
> This flag simply won't be defined in POSIX.
> 
> -Steve
> 
> 
> 
>         From: David Simcha <dsimcha at gmail.com>
>         To: Discuss the phobos library for D <phobos at puremagic.com>
>         Sent: Mon, August 16, 2010 10:11:40 AM
>         Subject: Re: [phobos] Removing std.stdio.File.popen()
> 
>         This looks terrific.  I've always found the old std.process to
>         be way underpowered, especially on Windows.  Does your
>         statement about cross-platformness imply that Windows will
>         eventually be supported, too?
> 
>         On Mon, Aug 16, 2010 at 9:20 AM, Lars Tandle Kyllingstad
>         <lars at kyllingen.net> wrote:
>                 On Mon, 2010-08-16 at 09:04 -0400, Adam Ruppe wrote:
>                 > I actually use it (which is why I duplicated your
>                 bug), but am OK with
>                 > removing it, since it is easy enough to get at
>                 anyway. For a while, I
>                 > did a separate extern(C) for pclose anyway!
>                 >
>                 > However, I don't think something being POSIX only is
>                 a good reason to
>                 > remove something. D should take advantages of
>                 whatever platform it is
>                 > on. Portability is good when you can have it, but it
>                 shouldn't be a
>                 > function killer alone.
> 
> 
>                 Two comments:
> 
>                 1. I disagree with you. :)  I think that Phobos'
>                 user-visible interface
>                 should be completely platform agnostic.  Code that
>                 depends only on
>                 Phobos should compile and run on any platform.
> 
>                 2. Steve and I have been working on a new version of
>                 std.process, which
>                 will at some point, hopefully, obviate the need for
>                 popen().  See
>                 pipeProcess() here:
> 
>                  http://www.kyllingen.net/code/ltk/doc/process.html
> 
>                 The POSIX implementation is more or less complete, but
>                 its inclusion in
>                 Phobos is currently being blocked by bug 3979.  Also,
>                 Steve has run into
>                 some very tricky issues with pipes on Windows,
>                 fundamentally caused by
>                 D's dependence on the DMC runtime.  I don't know how
>                 (or if) that is
>                 working out.
> 
>                 -Lars
> 
> 
>                 _______________________________________________
>                 phobos mailing list
>                 phobos at puremagic.com
>                 http://lists.puremagic.com/mailman/listinfo/phobos
> 
> 
> 
> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


August 16, 2010
Well, like I said, I wrote code that compiled.  I haven't been able to test it because of the "circular dependency" problem artifically introduced by the workaround for 3979 :)

I think it's correct, Walter sent me enough snipits from DMC's runtime internals so I could do it.  Only testing will tell....

BTW, are you in a position to test Rainer's patch on bug 3979?  I don't have time right now to build/test a compiler patch (not to mention, I've never built dmd before).

-Steve



----- Original Message ----
> From: Lars Tandle Kyllingstad <lars at kyllingen.net>
> To: Discuss the phobos library for D <phobos at puremagic.com>
> Sent: Mon, August 16, 2010 11:29:50 AM
> Subject: Re: [phobos] Removing std.stdio.File.popen()
> 
> Does that mean you figured out the whole FILE* <--> HANDLE thing?   If so, that's awesome!
> 
> -Lars
> 
> 
> 
> On Mon, 2010-08-16 at  07:28 -0700, Steve Schveighoffer wrote:
> > I have a fully compiling Windows  version ready to test, but issue 3979 blocks that.  I didn't have  the patience that Lars had to build it outside of phobos, so I just put  it on hold for now :)  But yes, everything that std.process  supports will be doable on both phobos and Windows with a common  interface.  There will be one minor difference -- Windows has a GUI  flag that prevents a console window from appearing.  This is  important to people who are running programs they don't want to pop up  temporary console windows.
> > 
> > This flag simply won't be defined in  POSIX.
> > 
> > -Steve
> > 
> > 
> > 
> >         From: David Simcha <dsimcha at gmail.com>
> >          To: Discuss the phobos library for D <phobos at puremagic.com>
> >          Sent: Mon, August 16, 2010 10:11:40 AM
> >          Subject: Re: [phobos] Removing  std.stdio.File.popen()
> > 
> >          This looks terrific.  I've always found the old std.process  to
> >         be way underpowered, especially on  Windows.  Does your
> >         statement about  cross-platformness imply that Windows will
> >          eventually be supported, too?
> > 
> >          On Mon, Aug 16, 2010 at 9:20 AM, Lars Tandle  Kyllingstad
> >         <lars at kyllingen.net> wrote:
> >                  On Mon, 2010-08-16 at 09:04  -0400, Adam Ruppe wrote:
> >                  > I actually use it (which is why I duplicated your
> >                  bug), but am OK  with
> >                 >  removing it, since it is easy enough to get at
> >                  anyway. For a while, I
> >                  > did a separate extern(C) for  pclose anyway!
> >                  >
> >                 >  However, I don't think something being POSIX only is
> >                  a good reason to
> >                  > remove something. D should take  advantages of
> >                  whatever platform it is
> >                  > on. Portability is good when you can have it, but it
> >                  shouldn't be a
> >                  > function killer  alone.
> > 
> > 
> >                  Two comments:
> > 
> >                  1. I disagree with you. :)  I think  that Phobos'
> >                  user-visible interface
> >                  should be completely platform agnostic.  Code that
> >                  depends only on
> >                  Phobos should compile and run  on any platform.
> > 
> >                 2. Steve and I  have been working on a new version of
> >                  std.process, which
> >                  will at some point, hopefully, obviate the need  for
> >                  popen().  See
> >                  pipeProcess() here:
> > 
> >                   http://www.kyllingen.net/code/ltk/doc/process.html
> > 
> >                  The POSIX implementation is more or less complete,  but
> >                 its  inclusion in
> >                  Phobos is currently being blocked by bug 3979.  Also,
> >                  Steve has run into
> >                  some very tricky issues with  pipes on Windows,
> >                  fundamentally caused by
> >                  D's dependence on the DMC runtime.  I don't know how
> >                  (or if) that is
> >                  working out.
> > 
> >                  -Lars
> > 
> > 
> >                  _______________________________________________
> >                  phobos mailing list
> >                 phobos at puremagic.com
> >                   http://lists.puremagic.com/mailman/listinfo/phobos
> > 
> > 
> > 
> > 
> >  _______________________________________________
> > phobos mailing  list
> > phobos at puremagic.com
> > http://lists.puremagic.com/mailman/listinfo/phobos
> 
> 
> _______________________________________________
> phobos  mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
> 



August 17, 2010
Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> 2. Steve and I have been working on a new version of std.process, which
> will at some point, hopefully, obviate the need for popen().  See
> pipeProcess() here:
> 
>   http://www.kyllingen.net/code/ltk/doc/process.html

I'm looking forward to seeing the result! :-)


> The POSIX implementation is more or less complete, but its inclusion in Phobos is currently being blocked by bug 3979.  Also, Steve has run into some very tricky issues with pipes on Windows, fundamentally caused by D's dependence on the DMC runtime.  I don't know how (or if) that is working out.

Will the new std.process use C stdio?

I think dependency to FILE* should be minimized, as C stdio has several issues (wide oriented streams, poor bidirectional buffering, etc...). IMHO using FILE* just for the sake of buffering is not a very good idea.


Shin
August 16, 2010
...not to mention that on 32-bit standard C FILE*s are 32-bit and do weird things when you get over the 2GB mark.  IMHO this is by far the biggest problem with them.  Any mature I/O API must not be subject to such arbitrary limitations provided that the underlying platform isn't subject to them.

On Mon, Aug 16, 2010 at 12:53 PM, Shin Fujishiro <rsinfu at gmail.com> wrote:

> Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> > 2. Steve and I have been working on a new version of std.process, which
> > will at some point, hopefully, obviate the need for popen().  See
> > pipeProcess() here:
> >
> >   http://www.kyllingen.net/code/ltk/doc/process.html
>
> I'm looking forward to seeing the result! :-)
>
>
> > The POSIX implementation is more or less complete, but its inclusion in Phobos is currently being blocked by bug 3979.  Also, Steve has run into some very tricky issues with pipes on Windows, fundamentally caused by D's dependence on the DMC runtime.  I don't know how (or if) that is working out.
>
> Will the new std.process use C stdio?
>
> I think dependency to FILE* should be minimized, as C stdio has several issues (wide oriented streams, poor bidirectional buffering, etc...). IMHO using FILE* just for the sake of buffering is not a very good idea.
>
>
> Shin
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100816/7f48ac51/attachment.html>
August 16, 2010
David Simcha wrote:
> ...not to mention that on 32-bit standard C FILE*s are 32-bit and do weird things when you get over the 2GB mark.  IMHO this is by far the biggest problem with them.

I don't understand this. So are you saying that the FILE pointer itself has issues?

By and large, I dislike playing nice with FILE* as much as the next guy but I've looked into this many times and couldn't find a way to either play nice with C libraries, or downgrading the importance of doing so.


Andrei
August 16, 2010
Well, I don't really know for sure.  All I know is that the standard C API for file I/O does weird things on 32-bit Windows and Linux with files >= 2 GB, and takes ints in places where a properly designed API would take something wider.  Phobos merely propagates the defects of the underlying C API.

On Mon, Aug 16, 2010 at 1:05 PM, Andrei Alexandrescu <andrei at erdani.com>wrote:

> David Simcha wrote:
>
>> ...not to mention that on 32-bit standard C FILE*s are 32-bit and do weird things when you get over the 2GB mark.  IMHO this is by far the biggest problem with them.
>>
>
> I don't understand this. So are you saying that the FILE pointer itself has issues?
>
> By and large, I dislike playing nice with FILE* as much as the next guy but I've looked into this many times and couldn't find a way to either play nice with C libraries, or downgrading the importance of doing so.
>
>
> Andrei
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100816/cfb7d614/attachment.html>
August 16, 2010
I also like ltk process quite a bit. One q - why the need for a special type UnbufferedFile?

Andrei

David Simcha wrote:
> This looks terrific.  I've always found the old std.process to be way underpowered, especially on Windows.  Does your statement about cross-platformness imply that Windows will eventually be supported, too?
> 
> On Mon, Aug 16, 2010 at 9:20 AM, Lars Tandle Kyllingstad <lars at kyllingen.net <mailto:lars at kyllingen.net>> wrote:
> 
>     On Mon, 2010-08-16 at 09:04 -0400, Adam Ruppe wrote:
>      > I actually use it (which is why I duplicated your bug), but am OK
>     with
>      > removing it, since it is easy enough to get at anyway. For a while, I
>      > did a separate extern(C) for pclose anyway!
>      >
>      > However, I don't think something being POSIX only is a good reason to
>      > remove something. D should take advantages of whatever platform it is
>      > on. Portability is good when you can have it, but it shouldn't be a
>      > function killer alone.
> 
>     Two comments:
> 
>     1. I disagree with you. :)  I think that Phobos' user-visible interface
>     should be completely platform agnostic.  Code that depends only on
>     Phobos should compile and run on any platform.
> 
>     2. Steve and I have been working on a new version of std.process, which
>     will at some point, hopefully, obviate the need for popen().  See
>     pipeProcess() here:
> 
>      http://www.kyllingen.net/code/ltk/doc/process.html
> 
>     The POSIX implementation is more or less complete, but its inclusion in
>     Phobos is currently being blocked by bug 3979.  Also, Steve has run into
>     some very tricky issues with pipes on Windows, fundamentally caused by
>     D's dependence on the DMC runtime.  I don't know how (or if) that is
>     working out.
> 
>     -Lars
> 
>     _______________________________________________
>     phobos mailing list
>     phobos at puremagic.com <mailto:phobos at puremagic.com>
>     http://lists.puremagic.com/mailman/listinfo/phobos
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
August 16, 2010
As a random plug for DMC... the full compiler is like $50 and includes the complete library source.  If you can afford the cost, I strongly suggest just buying a CD :-)

On Aug 16, 2010, at 8:46 AM, Steve Schveighoffer wrote:

> Well, like I said, I wrote code that compiled.  I haven't been able to test it because of the "circular dependency" problem artifically introduced by the workaround for 3979 :)
> 
> I think it's correct, Walter sent me enough snipits from DMC's runtime internals so I could do it.  Only testing will tell....
> 
> BTW, are you in a position to test Rainer's patch on bug 3979?  I don't have time right now to build/test a compiler patch (not to mention, I've never built dmd before).

August 17, 2010
I tested Rainer's patch now, and it fixes the problem! :)

-Lars



On Mon, 2010-08-16 at 08:46 -0700, Steve Schveighoffer wrote:
> Well, like I said, I wrote code that compiled.  I haven't been able to test it because of the "circular dependency" problem artifically introduced by the workaround for 3979 :)
> 
> I think it's correct, Walter sent me enough snipits from DMC's runtime internals so I could do it.  Only testing will tell....
> 
> BTW, are you in a position to test Rainer's patch on bug 3979?  I don't have time right now to build/test a compiler patch (not to mention, I've never built dmd before).
> 
> -Steve
> 
> 
> 
> ----- Original Message ----
> > From: Lars Tandle Kyllingstad <lars at kyllingen.net>
> > To: Discuss the phobos library for D <phobos at puremagic.com>
> > Sent: Mon, August 16, 2010 11:29:50 AM
> > Subject: Re: [phobos] Removing std.stdio.File.popen()
> > 
> > Does that mean you figured out the whole FILE* <--> HANDLE thing?   If so, that's awesome!
> > 
> > -Lars
> > 
> > 
> > 
> > On Mon, 2010-08-16 at  07:28 -0700, Steve Schveighoffer wrote:
> > > I have a fully compiling Windows  version ready to test, but issue 3979 blocks that.  I didn't have  the patience that Lars had to build it outside of phobos, so I just put  it on hold for now :)  But yes, everything that std.process  supports will be doable on both phobos and Windows with a common  interface.  There will be one minor difference -- Windows has a GUI  flag that prevents a console window from appearing.  This is  important to people who are running programs they don't want to pop up  temporary console windows.
> > > 
> > > This flag simply won't be defined in  POSIX.
> > > 
> > > -Steve
> > > 
> > > 
> > > 
> > >         From: David Simcha <dsimcha at gmail.com>
> > >          To: Discuss the phobos library for D <phobos at puremagic.com>
> > >          Sent: Mon, August 16, 2010 10:11:40 AM
> > >          Subject: Re: [phobos] Removing  std.stdio.File.popen()
> > > 
> > >          This looks terrific.  I've always found the old std.process  to
> > >         be way underpowered, especially on  Windows.  Does your
> > >         statement about  cross-platformness imply that Windows will
> > >          eventually be supported, too?
> > > 
> > >          On Mon, Aug 16, 2010 at 9:20 AM, Lars Tandle  Kyllingstad
> > >         <lars at kyllingen.net> wrote:
> > >                  On Mon, 2010-08-16 at 09:04  -0400, Adam Ruppe wrote:
> > >                  > I actually use it (which is why I duplicated your
> > >                  bug), but am OK  with
> > >                 >  removing it, since it is easy enough to get at
> > >                  anyway. For a while, I
> > >                  > did a separate extern(C) for  pclose anyway!
> > >                  >
> > >                 >  However, I don't think something being POSIX only is
> > >                  a good reason to
> > >                  > remove something. D should take  advantages of
> > >                  whatever platform it is
> > >                  > on. Portability is good when you can have it, but it
> > >                  shouldn't be a
> > >                  > function killer  alone.
> > > 
> > > 
> > >                  Two comments:
> > > 
> > >                  1. I disagree with you. :)  I think  that Phobos'
> > >                  user-visible interface
> > >                  should be completely platform agnostic.  Code that
> > >                  depends only on
> > >                  Phobos should compile and run  on any platform.
> > > 
> > >                 2. Steve and I  have been working on a new version of
> > >                  std.process, which
> > >                  will at some point, hopefully, obviate the need  for
> > >                  popen().  See
> > >                  pipeProcess() here:
> > > 
> > >                   http://www.kyllingen.net/code/ltk/doc/process.html
> > > 
> > >                  The POSIX implementation is more or less complete,  but
> > >                 its  inclusion in
> > >                  Phobos is currently being blocked by bug 3979.  Also,
> > >                  Steve has run into
> > >                  some very tricky issues with  pipes on Windows,
> > >                  fundamentally caused by
> > >                  D's dependence on the DMC runtime.  I don't know how
> > >                  (or if) that is
> > >                  working out.
> > > 
> > >                  -Lars
> > > 
> > > 
> > >                  _______________________________________________
> > >                  phobos mailing list
> > >                 phobos at puremagic.com
> > >                   http://lists.puremagic.com/mailman/listinfo/phobos
> > > 
> > > 
> > > 
> > > 
> > >  _______________________________________________
> > > phobos mailing  list
> > > phobos at puremagic.com
> > > http://lists.puremagic.com/mailman/listinfo/phobos
> > 
> > 
> > _______________________________________________
> > phobos  mailing list
> > phobos at puremagic.com
> > http://lists.puremagic.com/mailman/listinfo/phobos
> > 
> 
> 
> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos