[M3devel] [M3commit] CVS Update: cm3
Jay
jayk123 at hotmail.com
Sun Jan 20 07:34:14 CET 2008
Mika, while I agree such a target might be interesting, and might just about work now, there is another target that is also definitely interesting, and more interesting to some folks, and perhaps more efficient, smaller, faster. There needs to be a way to ask for one or the other.
People want one. People want the other. I think I've seen about two people ask for each. Wow a small number.
There are tools and there is runtime, and you can pick and chose.
But too many choices and people get confused, so there's a need to prepackage some combinations under small names.
At the moment, NT386GNU means use GNU tools, but otherwise be like NT386.
There are really several variables in all this.
There are three threading models available, and they probably all work or could be easily made to.
There are two underlying GUI libraries, ditto.
There is PERHAPS Win9x compatibility to consider. Cygwin is dropping that in newer versions.
What is a "target"? vs. what is a "configuration"?
Odds are fairly good that if you merely alter $PATH one way or the other, and undo my small changes below to what m3makefile includes what, and what cm3 assumes OSTYPE is, Cygwin will work, at least as well as I have NT386GNU otherwise working. That is, all three of these targets are so darn similar that is almost just a matter of "configuration" and could perhaps be made so. I am reluctant to blow up the size of jmpbuf to enable arbitrary mixing however.
The tricky part is not so much making it work, but what to call it, how to expose it to users, as well as perhaps streamlining the setup.
I am better at "making it work" however and am open to suggestions all around.
There is yet another direction and it is obviously the direction things were going -- neither GNU nor MS tools.
There is already the x86 backend written in Modula-3. It is noticably very much faster than the gcc backend. There is very little C code in the system and it could probably all be rewritten in Modula-3..the beauty of its "optional safety"...though your point is very valid as to outside the system. There is already a start of a runtime linker that loads .objs. The C runtime dependency is very very minimal already. Finish those last two points and you have a "self contained" system , from a certain point of view, a common point of view, though there is still the dependency on kernel32.dll, user32.dll, gdi32.dll, the "OS" as people like to label it, though it is really just another bunch of code in most respects and not something as "special" as people think, and you can be more or less dependent on it as well -- remember that Modula-3 when using the vtalarm threads does its own scheduling (I think), a task people normally think of as provided by an "OS".
(I believe Mary Fernandez already wrote a relatively easily retargetable linker and debugger in Modula-3, but I could be wrong.)
I just realized another target -- NT386-Interix or such, these days known as "Services for Unix" and I think a free download.
This is YET ANOTHER very Posixish environment.
As well, there is the question from earlier of "What is Posix?"
It's not like Microsoft doesn't provide open/read/write/close. They do.
What all is in the Cygwin headers that people want?
The availability of sh should have little impact on your Modula-3 code, right? You aren't running command lines in it, right?
It's not like portable standard C and C++ can't be compiled just as well, if not better and faster, by the Microsoft compiler. It can be.
I realize there are details, levels of ANSI conformity, and there are language extensions on both sides.
Now, since I have been debugging stuff lately, I realize there could be a big question as to debuggers.
More importantly, debug information format.
My experience lately is that this is an either/or choice, and you can't have it both ways.
If you are very used to gdb/m3gdb, you must use the GNU tools. But you don't need Cygwin (except to build m3gdb or acquire gdb).
If you are very used to windbg/ntsd/cdb/Visual Studio, well you must use the non-gcc backend, the Microsoft C compiler for the little bit of C/C++ if you want to debug it, the Microsoft linker I assume, however you aren't going to be likely happy. The non-gcc backend only outputs line number information, no types, no locals. It's not a pleasant experience, but at least you can see the stack. You can also to some extent use both. You can build your code for either platform and flit around between the two. Or you can flit around between debuggers and deal with a lack of symbols in one, and just poke around in memory, using information gleaned from the other.
But again, this doesn't have much to do with Cygwin or not Cygwin. I've only been going at this a short time, so maybe gdb does better with the Cygwin output. I don't know.
Sorry for the tone. We are actually in agreement, essentially. I have been largely on the fence and just asking what to call things, and everyone else is clearly on one side or the other. I personally will not use Cygwin if I can help it, but I do use it for cvs and ssh at least. I actually hardlink swaths of it into my Windows directory, the useful command line utilities, that which likely one non-configurable version would suffice -- ie: not gcc/ld/ar/as. If there was one true gcc/ld/ar/as, I would hardlink it in too. Likewise with cl/link. e.g. I have windiff in there, but not cl/link. I don't want that cygwin1.dll dependency and then have to understand the licensing...
So the non-Cygwin target came first. It is easier. It is faster. It is what I prefer.
Maybe there will be a Cygwin target. Maybe someone else will provide it?
It should be clear btw that the real work here was all done for us in gcc/ld, and cm3. The rest is easier.
Besides..who is going to do the work here, and who is going to use it?
Are Windows users asking for a more Posixish system or are Posix users saying what Windows should be like? Will they move to it?
Bah humbug.
- Jay
> To: hosking at cs.purdue.edu> To: m3devel at elegosoft.com> Date: Sat, 19 Jan 2008 19:46:03 -0800> From: mika at async.caltech.edu> Subject: Re: [M3devel] [M3commit] CVS Update: cm3> > Can I add a perhaps obvious observation?> > NT386GNU must, of all things, mean that the code will compile and> link cleanly, with a minimum of fuss, against Cygwin's headers> and libraries. I have never used MS's C tools so I don't know> if this is the case with them. It is of course the case when> you use GNU ld, etc.> > When building large software in Modula-3 it's almost inevitable> that, since the language is used by so few people, you will have a> need to call out to C code (or Fortran code, or some other compiled> code, with C interfaces). If you develop on Unix and use Cygwin> to port to Windows, it makes no sense to distinguish between NT386> and NT386GNU unless the latter has pretty much the same environment> as the Unix system.> > Mika> > Tony Hosking writes:> >So, I am very confused now. Does NT386GNU no longer mean use of the > >full set of GNU tools m3cc/ld/as, as would be available under > >Cygwin? I thought the point of this was to be able to run in as much > >of a GNU environment as possible. GNU to me means the whole > >toolsuite not just m3cc. To me, a GNU-based environment on Windows > >holds great attraction, since it consists of tools that I generally > >always install on Windows, that I know, and are similar to the other > >platforms I use.> >> >On Jan 19, 2008, at 4:11 AM, Jay Krell wrote:> >> >> CVSROOT: /usr/cvs> >> Changes by: jkrell at birch. 08/01/19 04:11:34> >>> >> Modified files:> >> cm3/m3-libs/m3core/src/runtime/: m3makefile> >> cm3/m3-sys/cminstall/src/config/: NT386GNU> >> cm3/m3-sys/m3front/src/builtinInfo/: InfoModule.m3> >> cm3/m3-sys/m3middle/src/: Target.m3> >>> >> Log message:> >> m3-sys/m3middle/src/Target.m3> >> m3-libs/m3core/src/runtime/m3makefile> >> m3-sys\m3front\src\builtinInfo\InfoModule.m3> >> > >> switch NT386GNU to be Win32 instead of POSIX> >> switch NT386GNU to _setjmp instead of setjmp> >> jmp_buf size still big like Cygwin> >> rewrite NT386GNU config file -- almost identical to NT386> >> mingwin required for building Modula-3 programs> >> mingwin AND msys required for building m3cc> >> > >> To boot:> >> > >> install Python (www.activestate.com)> >> > >> have a working NT386 system> >> get current source> >> Mine is at c:\dev2\cm3.2 (cm3 is has other paused work, dev was > >> taken by Unix)> >> > >> get and install binary distribution (5.1.3 works, anything newer > >> should work)> >> I install to c:\cm3> >> copy %CVSROOT%\m3-sys\cminstall\src\config\cm3.cfg to \cm3\bin > >> \cm3.cfg> >> > >> Have a Visual C++ toolset (cl and link)> >> and run the vcvars link on the start menu (this can/will be made > >> easier)> >> Almost any version should work.> >> if you are using Visual C++ 8.0 (RTM?), rename away its mt.exe> >> and get a newer from such as from the Platform SDK. Otherwise it > >> crashes.> >> This is not specific to NT386GNU, just that I recently removed the > >> Platform SDK> >> from my %PATH%.> >> > >> cd %CVSROOT%\scripts\python> >> .\upgrade> >> > >> install msys and mingwin from http://www.mingw.org (links to > >> SourceForge)> >> for mingwin, you only need the "base"> >> msys tells you to avoid mingwin make, in favor of msys make, and I > >> did that> >> > >> I install to the defaults> >> c:\msys\1.0> >> c:\mingw> >> > >> if you don't install to the defaults, add> >> <msys>\bin and <mingwin\bin to $PATH (in which order? I add> >> to the start, but which order between the two?)> >> > >> if you do install to the defaults, scripts\python will fix path > >> for you,> >> if there is no gcc/as/sh on our $PATH> >> > >> cd %CVSROOT%\scripts\python> >> upgrade && bootntgnu> >> > >> NOTE THE RESULTING BINARIES DO NOT YET WORK, but this is still > >> progress.> >> > >> These instructions inevitably to be further tested and refined and > >> placed elsewhere!
_________________________________________________________________
Climb to the top of the charts! Play the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080120/c8b40395/attachment-0002.html>
More information about the M3devel
mailing list