[M3devel] religion, philosophy, Posix vs. Win32

Tony Hosking hosking at cs.purdue.edu
Mon Jan 14 01:13:17 CET 2008


I really don't know enough about Windows to answer these questions  
properly.

My take on it is: since Cygwin is intended to give a Linux-like  
environment on Windows, then it should behave more like a Linux  
system than a Windows system.  That is, CM3 will look like it is  
running on some (strange) flavor of Linux.  That said, the threading  
sub-system might be implemented as ThreadWin32 instead of ThreadPosix  
just to get system-level thread scheduling (ie, good for multi-core),  
similarly to the way ThreadPThread is used on some POSIX targets.   
The rest of things with Cygwin should behave like any other POSIX  
target.

Perhaps someone else out there with better Windows knowledge can  
respond more intelligently than I have.

On Jan 13, 2008, at 6:36 PM, Jay wrote:

> The conclusion here is:
>  Just try to convince me otherwise. :)
>
> The gist of the question is:
>   Just what characteristics of "Posix" and "Win32" should  
> "NT386GNU" have?
>
>  Just what characteristics of "Posix" do people notice and like?
> You can't say "the whole thing". :)
>
> Restated:
>
> What is Posix? I don't mean, where is the standard document web site.
> I mean what is it TO YOU?
>
> Is it open/read/write/close?
> Is it fork?
> Is it sbrk?
>   On these previous ones, they are interesting to many programmers,
>  but Modula-3 already layers over all this, so these are unlikely  
> defining
> characteristics here.
>
> Is it sh? Probably somewhat. But if have you sat in Cygwin sh much  
> vs. cmd?
>  It is annoying. Command line history is flaky. Paths are munged to  
> say /cygdrive.
>  You lose the critical F8 command line completion against history  
> feature.
>   You lose a lot of editing capability, but do gain some alternate  
> possibly "portable"
>   similar.
>
> Is it Perl? No.
> Is it X Windows. I doubt it.
> Is it pthreads? Probably not.
>   Or at least vtalarm? Maybe?
>   Or setjmp/longjmp? Ok.
>     Longjmp to the same buffer multiple times? Not likely.
>     Longjmp to a place that has already returned? Not likely.
> All full paths starting with a forward slash? Maybe.
>   Backward slash being a valid non-seperator path character? Maybe.
>
> Think about that last one.
> It is valid and occurs in Win32 code to treat forward slash and  
> backward slash the same.
> Some code does, some code does not.
> What if you just did that unconditionally, like even in Posix?
> What is the role of backward slash in Posix paths? It either just  
> doesn't occur,
> or is an escape character, or is a regular character. Something at  
> a low level
> could replace the backward slashes with forward slashes.
>
> I would like to change the code in m3-sys/cm3/m3path.m3 to treat  
> backward slashes
> and forward slashes the same. Backward slashes just won't occur on  
> Posix, right?
> So far I have managed without this change, but not having it has  
> bitten me a few times.
> I do have the analogous change to the Win32 path code in m3core.
>
> It is the redundant filenames libfoo.a instead of foo.lib and  
> libfoo.so instead of foo.so?
> Perhaps. This seems dumb, redundant to me. Why have prefixes and  
> suffixes?
> Don't suffixes suffice?
>
> That all said, I remain convinced that a useful intermediate or  
> probably endpoint
> is a toolset that targets Windows using cm3cg, ld, as, but  
> otherwise looks like
> NT386 as much as possible. MAYBE alter the library names to libfoo.*.
>
> sh and make are needed for building cm3cg.
> I did use Cygwin for that. MinGWin sounds promising here too but I  
> haven't tried.
>
>  - Jay
>
>
> Get the power of Windows + Web with the new Windows Live. Get it now!




More information about the M3devel mailing list