<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>I agree cross-buildability is nice. That is something NT-non-GNU will never have to the extent that NT-GNU would have, other than cross building from Windows x86 <=> Windows AMD64, etc., or NT => CE, or NT <=> 9x, which is all a fairly large set of cross combinations that do work..<BR>
<BR>
You can have portability at one or more layers..and all that.<BR>
How many/much do you want?<BR>
At the Modula-3 level and at the C level and at the command line human interface/"scripting" level (for scripting, just use Quake or Perl or Python, really).<BR>
<BR>
For now my priority is using the gcc backend and the associated as and ld and possibly dlltool.<BR>
And buildability of the gcc backend which requires much more, but is easy enough, I cross that bridge days ago.<BR>
<BR>
For some reason the gcc produced mklib.exe crashes at startup, I believe here:<BR>C:\dev2\cm3.2\m3-libs\m3core\src\runtime\common\RTLinker.m3(81): IF (imp.import = NIL) THEN imp.import := imp.binder (0); END;<BR>or here:<BR>
C:\dev2\cm3.2\m3-libs\m3core\src\runtime\common\RTLinker.m3(182): IF (imp.import = NIL) THEN imp.import := imp.binder (0); END;<BR><BR>
imp.binder is NULL. I'm sure there was a check for NULL followed by a jump to NULL and recall the callstack was to around here.<BR>
<BR>
You can actually debug it with gdb. :)<BR>
That was kind of nice.<BR>
I'm not sure about looking at globals -- info globals just said I had void pointers, but at least I could see the stack.<BR>
<BR>
Not that I must use mklib, but I was considering it, and it should work....<BR>
<BR>
32 bit time_t is a nightmare waiting to happen.<BR>
Have folks upgraded to 64 bit time_t?<BR>
Win32, depending on the layer, supports 32 bit time_t seconds since 1970, 64 bit time_t I assume with the same start, and 64 bit time since 1601 something like 100's of nanoseconds, low enough precision to have a plenty large range (i.e. it isn't measuring 4 billionths of seconds and therefore would have already run out. :) )<BR>
Having time start at 1970 can be a bit inconenient. It is fine for the timestamps on files, but, e.g. for birthdays?<BR>
Admittedly 1601 isn't adequate either for historical purposes, and eventually, if you are dealing with history, the Gregorian calendar runs out back in time and things get even much more complicated. :)<BR>
<BR>
- Jay<BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
Date: Mon, 14 Jan 2008 03:32:37 +0100<BR>From: dabenavidesd@yahoo.es<BR>Subject: Re: [M3devel] religion, philosophy, Posix vs. Win32<BR>To: mika@async.caltech.edu; jayk123@hotmail.com<BR>CC: m3devel@elegosoft.com<BR><BR>Hi all,<BR>Yes, I also noticed the Time.T issue in pm3 1.1.15 because I was trying to get compiled m3browser and I finally arranged to do that, but the program just broke, and I didn't know about cygwin differences against a real UNIX platform.<BR><BR>Also in that pm3 NT386GNU, the winvbt implementation was the one of dec-src not like current cm3 winvbt (that use WIDECHAR as I remember)<BR><BR>I tried to have the same interfaces to be able to use from m3browser.<BR>Now fortunately you can compile m3browser with NT386 cm3 platform.<BR><BR>I just liked very much the way one can make a bootstrap from pm3 from one platform to another and make a minimal compiler for NT386GNU:<BR>http://tkb.mpl.com/~tkb/software/misc/pm3-NT386GNU.patch<BR><BR>I couldn't repeat the above link instructions in a Debian Sarge machine, with all the pm3 Debian packages installed (available in the Debian Woody http://archive.debian.org/pool/main/p/pm3/ ) I think the reason was I was unable to do all the bootstrap process http://archive.debian.org/pool/main/p/pm3-i386<BR><BR><BR>I would like to have that kind of posix to cygwin capability of port at least a minimal compiler/runtime system.<BR><BR>Also, talking about the topic of port NT386 to NT386GNU (more than a year ago) I got some answer from Bert Laverman, <BR><BR>
<DIV class=EC_reply_level0>Daniel Benavides wrote: </DIV>
<DIV class=EC_reply_level1>> What if we use the cygwin platform to run cm3, an use its runtime </DIV>
<DIV class=EC_reply_level1>> of linker and c Compiler? </DIV>
<DIV class=EC_reply_level0>"Normally this involves a speed penalty, because cygwin will emulate </DIV>
<DIV class=EC_reply_level0>a UNIX environment, and has to translate this to Windows calls. The </DIV>
<DIV class=EC_reply_level0>advantage is of course that you can ignore most differences between </DIV>
<DIV class=EC_reply_level0>Windows and UNIX. </DIV>
<DIV class=EC_reply_level0>If you don't want the speed penalty, and can take care of the </DIV>
<DIV class=EC_reply_level0>platform differences, then you can use the -mno-cygwin flag. However, </DIV>
<DIV class=EC_reply_level0>make sure you use only "real" Windows API calls." </DIV>
<DIV class=EC_reply_level0><BR></DIV>
<DIV class=EC_reply_level0>Bert Laverman<BR></DIV><BR><BR>Thanks<BR><BR><BR><BR><B><I>Mika Nystrom <mika@async.caltech.edu></I></B> escribió:
<BLOCKQUOTE class=EC_replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px">Jay,<BR><BR>I don't know if this is completely responsive to your question, and<BR>take it with a grain of salt because I have never programmed on a<BR>"pure" Windows system (and God willing, I never shall).<BR><BR>I expect the NT386GNU target, Cygwin, Windows-POSIX, whatever you<BR>call it, to look as much as Unix "as possible." (Obviously not,<BR>but as "reasonable".) The main things are (1) yes, /bin/sh, and<BR>(2) Unix (POSIX?) libc---Modula-3 does a good job of covering up<BR>the basic stuff so you don't need to worry about it for the most<BR>part, but sometimes, just sometimes, you need to get, say, some<BR>system information that doesn't have an existing M3 interface (say<BR>the amount of free diskspace or something like that). Then you<BR>should be able to call C code that is portable between Unix and<BR>Windows.<BR><BR>One thing that is bizarre about the old NT386GNU PM3 that doesn't<BR>conform to the above description: it uses Windows Time.T. It's all<BR>the more bizarre because Cygwin uses Unix time_t. (Time.Now and<BR>time(3) are off by a couple of hundred years on NT386GNU, whereas<BR>they are the same on all Unixes.) I am sure there are other things.<BR>Oh yes, the open-file (default) locking semantics are different<BR>too. Those two are actually the only differences that I noticed<BR>in the programming environments.<BR><BR>Mika<BR><BR>Jay writes:<BR>>--_d0659847-2f20-454a-9665-5df3b5ce2832_<BR>>Content-Type: text/plain; charset="iso-8859-1"<BR>>Content-Transfer-Encoding: quoted-printable<BR>><BR>>The conclusion here is:<BR>> Just try to convince me otherwise. :)<BR>><BR>>The gist of the question is:<BR>> Just what characteristics of "Posix" and "Win32" should "NT386GNU" have?<BR>><BR>> Just what characteristics of "Posix" do people notice and like?<BR>>You can't say "the whole thing". :)<BR>><BR>>Restated:<BR>><BR>>What is Posix? I don't mean, where is the standard document web site.<BR>>I mean what is it TO YOU?<BR>><BR>>Is it open/read/write/close?<BR>>Is it fork?<BR>>Is it sbrk?<BR>> On these previous ones, they are interesting to many programmers,<BR>> but Modula-3 already layers over all this, so these are unlikely defining<BR>>characteristics here.<BR>><BR>>Is it sh? Probably somewhat. But if have you sat in Cygwin sh much vs. cmd?<BR>> It is annoying. Command line history is flaky. Paths are munged to say /cy=<BR>>gdrive.<BR>> You lose the critical F8 command line completion against history feature.<BR>> You lose a lot of editing capability, but do gain some alternate possibly=<BR>> "portable"<BR>> similar.<BR>><BR>>Is it Perl? No.<BR>>Is it X Windows. I doubt it.<BR>>Is it pthreads? Probably not.<BR>> Or at least vtalarm? Maybe?<BR>> Or setjmp/longjmp? Ok.<BR>> Longjmp to the same buffer multiple times? Not likely.<BR>> Longjmp to a place that has already returned? Not likely.<BR>>All full paths starting with a forward slash? Maybe.<BR>> Backward slash being a valid non-seperator path character? Maybe.<BR>><BR>>Think about that last one.<BR>>It is valid and occurs in Win32 code to treat forward slash and backward sl=<BR>>ash the same.<BR>>Some code does, some code does not.<BR>>What if you just did that unconditionally, like even in Posix?<BR>>What is the role of backward slash in Posix paths? It either just doesn't o=<BR>>ccur,<BR>>or is an escape character, or is a regular character. Something at a low le=<BR>>vel<BR>>could replace the backward slashes with forward slashes.<BR>><BR>>I would like to change the code in m3-sys/cm3/m3path.m3 to treat backward s=<BR>>lashes<BR>>and forward slashes the same. Backward slashes just won't occur on Posix, r=<BR>>ight?<BR>>So far I have managed without this change, but not having it has bitten me =<BR>>a few times.<BR>>I do have the analogous change to the Win32 path code in m3core.<BR>><BR>>It is the redundant filenames libfoo.a instead of foo.lib and libfoo.so ins=<BR>>tead of foo.so?<BR>>Perhaps. This seems dumb, redundant to me. Why have prefixes and suffixes?<BR>>Don't suffixes suffice?<BR>><BR>>That all said, I remain convinced that a useful intermediate or probably en=<BR>>dpoint<BR>>is a toolset that targets Windows using cm3cg, ld, as, but otherwise looks =<BR>>like<BR>>NT386 as much as possible. MAYBE alter the library names to libfoo.*.<BR>><BR>>sh and make are needed for building cm3cg.<BR>>I did use Cygwin for that. MinGWin sounds promising here too but I haven't =<BR>>tried.<BR>><BR>> - Jay<BR>><BR>><BR>>_________________________________________________________________<BR>>Get the power of Windows + Web with the new Windows Live.<BR>>http://www.windowslive.com?ocid=3DTXT_TAGHM_Wave2_powerofwindows_012008=<BR>><BR>>--_d0659847-2f20-454a-9665-5df3b5ce2832_<BR>>Content-Type: text/html; charset="iso-8859-1"<BR>>Content-Transfer-Encoding: quoted-printable<BR>><BR>><BR>><BR>>
<STYLE>
.ExternalClass EC_>.hmmessage EC_P>
{;}
.ExternalClass EC_>body.hmmessage>
{;}
</STYLE>
<BR>><BR>>The conclusion here is:<BR> Just try to conv=<BR>>ince me otherwise. :)<BR><BR>The gist of the question is:<BR> Just wh=<BR>>at characteristics of "Posix" and "Win32" should "NT386GNU" have?<BR><BR>&n=<BR>>bsp;Just what characteristics of "Posix" do people notice and like?<BR>You =<BR>>can't say "the whole thing". :)<BR><BR>Restated:<BR><BR>What is Posix? I do=<BR>>n't mean, where is the standard document web site.<BR>I mean what is it TO =<BR>>YOU?<BR><BR>Is it open/read/write/close?<BR>Is it fork?<BR>Is it sbrk?<BR>&=<BR>>nbsp; On these previous ones, they are interesting to many programmers,<BR>=<BR>> but Modula-3 already layers over all this, so these are unlikely defi=<BR>>ning<BR>characteristics here.<BR><BR>Is it sh? Probably somewhat. But if ha=<BR>>ve you sat in Cygwin sh much vs. cmd?<BR> It is annoying. Command line=<BR>> history is flaky. Paths are munged to say /cygdrive.<BR> You lose the=<BR>> critical F8 command line completion against history feature.<BR> You=<BR>> lose a lot of editing capability, but do gain some alternate possibly "por=<BR>>table"<BR> similar.<BR><BR>Is it Perl? No.<BR>Is it X Windows. I doub=<BR>>t it.<BR>Is it pthreads? Probably not.<BR> Or at least vtalarm? Maybe=<BR>>?<BR> Or setjmp/longjmp? Ok.<BR> Longjmp to the sam=<BR>>e buffer multiple times? Not likely.<BR> Longjmp to a pla=<BR>>ce that has already returned? Not likely.<BR>All full paths starting with a=<BR>> forward slash? Maybe.<BR> Backward slash being a valid non-seperator=<BR>> path character? Maybe.<BR><BR>Think about that last one.<BR>It is valid an=<BR>>d occurs in Win32 code to treat forward slash and backward slash the same.<=<BR>>br>Some code does, some code does not.<BR>What if you just did that uncondi=<BR>>tionally, like even in Posix?<BR>What is the role of backward slash in Posi=<BR>>x paths? It either just doesn't occur,<BR>or is an escape character, or is =<BR>>a regular character. Something at a low level<BR>could replace the backward=<BR>> slashes with forward slashes.<BR><BR>I would like to change the code in m3=<BR>>-sys/cm3/m3path.m3 to treat backward slashes<BR>and forward slashes the sam=<BR>>e. Backward slashes just won't occur on Posix, right?<BR>So far I have mana=<BR>>ged without this change, but not having it has bitten me a few times.<BR>I =<BR>>do have the analogous change to the Win32 path code in m3core.<BR><BR>It is=<BR>> the redundant filenames libfoo.a instead of foo.lib and libfoo.so instead =<BR>>of foo.so?<BR>Perhaps. This seems dumb, redundant to me. Why have prefixes =<BR>>and suffixes?<BR>Don't suffixes suffice?<BR><BR>That all said, I remain con=<BR>>vinced that a useful intermediate or probably endpoint<BR>is a toolset that=<BR>> targets Windows using cm3cg, ld, as, but otherwise looks like<BR>NT386 as =<BR>>much as possible. MAYBE alter the library names to libfoo.*.<BR><BR>sh and =<BR>>make are needed for building cm3cg.<BR>I did use Cygwin for that. MinGWin s=<BR>>ounds promising here too but I haven't tried.<BR><BR> - Jay<BR><BR><BR><BR>> />
<HR>
Get the power of Windows + Web with the new Windows Live. <A href="http://%3cbr/" target=_blank>>=3D'http://www.windowslive.com?ocid=3DTXT_TAGHM_Wave2_powerofwindows_012008=<BR>>' target=3D'_new'>Get it now!</A><BR>>=<BR>><BR>>--_d0659847-2f20-454a-9665-5df3b5ce2832_--<BR></BLOCKQUOTE><BR>
<HR SIZE=1>
<BR><FONT face=Verdana size=-2>Web Revelación Yahoo! 2007:<BR>Premio Favorita del Público - <A href="http://es.promotions.yahoo.com/revelacion2007/favoritos/" target=_blank>¡Vota tu preferida!</A></FONT></BLOCKQUOTE><br /><hr />Watch “Cause Effect,” a show about real people making a real difference. <a href='http://im.live.com/Messenger/IM/MTV/?source=text_watchcause' target='_new'>Learn more</a></body>
</html>