Thanks, Peter! I agree that it wouldn't be worth adding code for special cases that can be run without forking. I thought that maybe I would right my own version of run for, say, a single pipe form, but I think I'll take John Cowan's advice and just build Chicken on cygwin.
As for getting fork-like functionality on Windows, one way of course is to use cygwin's implementation of fork on top of the Windows API, using CreateProcess(). I don't know the details at all, but I remember reading that it's a bit of work, since cygwin has to copy the state of the current process to the new one (making it slower than fork() on Unix which uses copy-on-write). So I think it is perfectly reasonable to declare that Chicken users on Windows that want process-fork must use cygwin. On Wed, Aug 7, 2013 at 10:22 AM, Peter Bex <[email protected]> wrote: > On Wed, Aug 07, 2013 at 09:34:18AM -0400, Omar Antolín Camarena wrote: >> Hi everyone! > > Hello, Omar! > >> I love the convenience of the SCSH process notation and would like to >> be able to use it on Windows, but it currently uses process-fork >> internally and this function is unavailable on native Windows chicken >> builds. I was a little surprised that the run macro in scsh-process >> uses process-fork, I expected it to use just the pipe functions from >> the posix unit. Why doesn't it, is it just to share code with the & >> macro or is there some obstacle to implement it using only the pipe >> functions? > > The reason is that scsh-process is extremely flexible in how it > allows you to wire up the input/output/error descriptors, via the EPF > (extended process form) notation. It's even possible to wire up > nonstandard file descriptors to Scheme objects or different programs. > > If I were to add a special treatment for "simple" process forms, that > would duplicate most of the code, I'm afraid. > >> Do people have any advice on getting the run macro from scsh-process >> to work on windows (I guess the & macro would definitely be harder) >> with a minimum of hassle? Should I install cygwin? (And then building >> chicken, I guess, since the chicken in the cygwin package list is old: >> 3.4) Try to reimplement (the subset I need of the functionality of) >> run using only pipes? > > Maybe there's some way to get fork-like functionality on Windows? > Then it could be "emulated" by the process-fork implementation of the > POSIX unit on Windows. That would require patching CHICKEN core, > but once done it would make a lot of programs a lot more portable. > > Cheers, > Peter > -- > http://www.more-magic.net -- Omar Antolín Camarena _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
