On 4/2/2020 1:45 PM, David Storrs wrote:
> On Thu, Apr 2, 2020 at 1:32 PM George Neuner <
gneu...@comcast.net> wrote:
> >
> > ... it is because of Windows that Racket doesn't provide raw (or Unix)
> > sockets. Racket tries to support all of its features across all target
> > platforms.
>
> I mean...Racket tries to be memory-safe etc, but it also has libraries
> like 'unsafe/foo'. There's already a unix-sockets library
> (
https://docs.racket-lang.org/unix-socket/index.html) that is
> Unix-only, which I found after starting this thread. Why not have
> core modules like unix/sockets and windows/thing-that-only-windows-has
> ? Seems more useful than simply not having the functionality at all.
Well, I'm not on the development team, so I can't speak for them. But,
IMO, things which don't work everywhere do not belong in the core -
they belong in contributed libraries ... which is where you found the
*nix-only library.
However, since (IIRC) 1803, Windows 10 does have a partial
implementation of Unix sockets which provides SOCK_STREAM service only
(no DGRAM or SEQPACKET) ... but there is no mention of this in the
platform docs (
docs.microsoft.com), and AFAIHS only a few developer
blogs have described how to get at it: e.g.,
https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
https://devblogs.microsoft.com/commandline/windowswsl-interop-with-af_unix/
https://github.com/MicrosoftDocs/WSL/tree/live/wsl-samples/afunix-wsl-interop/windows_server
I haven't tried to use Unix sockets on Windows, but I did check that the
"afunix.sys" driver is present on my 1903 system. [And yes, I know 2003
is due imminently ... as Scooby would say "rotsa ruck".]
Presumably the existing library could be extended to work on recent
versions of Windows 10, but that wouldn't help anyone still running
older versions. Or Windows 8.1. Windows 7 is EOL'd, but Windows 8.1
will be supported until 2023, so excluding it might pose a problem.
YMMV,
George