[phobos] std.process deprecations

Jonathan M Davis via phobos phobos at puremagic.com
Thu Aug 7 11:20:05 PDT 2014


> Sent: Thursday, August 07, 2014 at 11:03 AM
> From: "Lars Tandle Kyllingstad via phobos" <phobos at puremagic.com>
> To: "Phobos mailing list" <phobos at puremagic.com>
> Subject: Re: [phobos] std.process deprecations
>
> Inefficiency was never used as an argument.  The problem is that exec*
> does different things on Windows and POSIX.  In other words, a D program
> which uses std.process.exec* will have different observable behaviour on
> different platforms.  This is what bothers me.
>
>    - On POSIX systems, exec* overwrites the current process
>      with a new one.
>
>    - On Windows, exec* spawns a new, independent process and
>      exits the current one.
>

If they don't do the same thing on both platforms, then they shouldn't be the
same function. That totally breaks portability. Phobos functions should be
portable unless they're versioned to a specific OS. We may be stuck with
slightly different behavior on different OSes in some cases, but we should be
_very_ leery of it and try to avoid it as much as possible. Doing otherwise
is just begging for bugs.

It sounds like we should provide the functionality for both systems, but if
anyone is currently using these functions and expecting them to work the same
on both systems, they could be in for a big shock. So, these functions should
probably be replaced with system-specific versions for both POSIX and Windows
- be that in different modules or in the same module with different names.

- Jonathan M Davis


More information about the phobos mailing list