Date: Tue, 1 May 90 18:16:19 N From: madmats%elcgl.epfl.ch@CUNYVM.CUNY.EDU (Mats Weber) Subject: Modula-3 compiler I would like to get the Modula-3 compiler but have no ftp. Is it possible to get it on tape (Sun 3 or Vax TK50) ? Mats Weber Swiss Federal Institute of Technology EPFL DI LGL 1015 Lausanne Switzerland E-mail : madmats@elcgl.epfl.ch phone : +41 21 693 52 92 fax : +41 21 693 39 09 ------------------------------------------------------------------------------ Date: Tue, 1 May 90 14:51:57 PDT From: David Goldberg Subject: local procedures as parameters Is the following program valid? The compiler says "no", or more precisely File Main.m3, line 18: cannot assign nested procedures (Inner) but I think the manual (page 19, 4th paragraph) says "yes". David Goldberg goldberg@parc.xerox.com MODULE Main; TYPE Proc = PROCEDURE (i, j: INTEGER): INTEGER; PROCEDURE CallIt (p: Proc): INTEGER = BEGIN RETURN(p(3,4)); END CallIt; PROCEDURE Outer (i, j: INTEGER): INTEGER = VAR x: INTEGER := 7; PROCEDURE Inner (i, j: INTEGER): INTEGER = BEGIN RETURN (x * i + j); END Inner; BEGIN CallIt (Inner); END Outer; BEGIN (* start code *) END Main. ------------------------------------------------------------------------------ Date: Tue, 01 May 90 15:12:35 PDT From: Eric Muller Subject: Re: local procedures as parameters > Is the following program valid? The compiler says "no", or more precisely > File Main.m3, line 18: cannot assign nested procedures (Inner) > but I think the manual (page 19, 4th paragraph) says "yes". > David Goldberg > goldberg@parc.xerox.com 1.4 has a bug, fixed in 1.5. thanks, Eric. ------------------------------------------------------------------------------ Date: Wed, 02 May 90 16:36:03 +0100 From: mjj%computer-lab.cambridge.ac.uk@NSFnet-Relay.AC.UK Subject: m3dep for SRC Modula-3 'm3dep' is a tool that will analyse one or more directories of Modula-3 sources and generate a 'makefile' to rebuild the contents of the current directory. It is a standard part of the Olivetti distribution, and in anticipation of that system being put in the public domain, I have generated a version of 'm3dep' which produces a makefile according to the SRC Modula-3 conventions. In other respects, the tool operates under the Olivetti model. In particular, it requires that the directories (packages) that the current directory depends on be listed in a file called 'm3path'. (I have a script that sets M3PATH and M3OBJPATH from such a file). The makefile does not require M3PATH and M3OBJPATH to be set up, but it is necessary to set M3LIB to the location of the standard library. A directory name in an m3path can contain environment variables, so a simple program has a one line m3path file containing $(M3LIB). In general, the tool deduces the set of directories resulting from the transitive closure of 'm3path's, and generates a 'world' target to rebuild everything. Here is the makefile that results from the example program in section 5.3 of the SRC Modula-3 manual. ------------------------------------------------------------------------------- -- # Makefile generated by m3dep version 1.7i - for DEC SRC Modula-3 # Commands and flags CPP = /lib/cpp CPPFLAGS = -P -C M3C = m3 M3CFLAGS = M3L = m3 M3LFLAGS = # Stuff for recursive make RECURTARG = all MAKEDONE = ++makedone RECURMAKE = ++recurmake PWDX = /bin/pwd # (PWD often set by shell...) RM = /bin/rm TEST = /bin/test TOUCH = /usr/bin/touch .SUFFIXES: # override defaults .SUFFIXES: .mo .m3 .mp .io .i3 .ip .mp.m3: $(CPP) $(CPPFLAGS) $< $@ .m3.mo: $(M3C) -c $(M3CFLAGS) $< .ip.i3: $(CPP) $(CPPFLAGS) $< $@ .i3.io: $(M3C) -c $(M3CFLAGS) $< # Directories (except .) on the m3path DIR0 = /usr/lib/m3 INTOBJS = A.io MODOBJS = A.mo Main.mo INTSRCS = A.i3 MODSRCS = A.m3 Main.m3 PROGS = Main.out all: intobjs modobjs otherMakefile $(PROGS) intobjs: $(INTOBJS) modobjs: $(MODBJS) otherMakefile: -@if $(TEST) -f makefile.other ; then $(MAKE) -f makefile.other ; fi Main.out: Main.mo A.mo A.io $(M3L) -o Main.out $(M3LFLAGS) Main.mo A.io A.mo A.mo: A.i3 $(DIR0)/Wr.i3 $(DIR0)/Thread.i3 $(DIR0)/Stdio.i3 $(DIR0)/Rd.i3 Main.mo: $(DIR0)/Main.i3 A.i3 world: recur recurclean recur: @-if $(TEST) -f $(RECURMAKE) ; then \ echo -n 'recursive make: directory loop involving '; $(PWDX) ; \ elif $(TEST) ! -f $(MAKEDONE) ; then \ $(TOUCH) $(RECURMAKE) ; \ echo -n 'making $(RECURTARG) in '; $(PWDX) ; \ $(MAKE) CPP='$(CPP)' CPPFLAGS='$(CPPFLAGS)' M3C='$(M3C)' M3CFLAGS='$( M 3CFLAGS)' M3LFLAGS='$(M3LFLAGS)' RECURTARG='$(RECURTARG)' RECURMAKE='$(RECURMAK E )' PWDX='$(PWDX)' RM='$(RM)' TOUCH='$(TOUCH)' TEST='$(TEST)' MAKEDONE='$(MAKEDO N E)' M3L='$(M3L)' $(RECURTARG) ; \ $(TOUCH) $(MAKEDONE) ; \ fi @-$(RM) -f $(RECURMAKE) recurclean: @-$(RM) -f $(RECURMAKE) @-if $(TEST) -f $(MAKEDONE) ; then \ $(RM) -f $(MAKEDONE) ; \ fi listdirs: # RECURTARG=listdirs to list all directories clean: -$(RM) -f $(INTOBJS) $(MODOBJS) $(PROGS) $(RECURMAKE) $(MAKEDONE) ------------------------------------------------------------------------------- -- In this instance, since there is only a single directory, the 'world' target is redundant. Note that the library directory is excluded from 'world' (and from the list of files in the link step) because it is special (sigh). You may note the conditional compilation support. I just left this in with the extensions that the Olivetti system uses. The tool is, currently, compiled and built with the Olivetti system (on a PMAX) . Now that I have it, I can proceed with porting more of the Olivetti world to the SRC compiler. Mick Jordan ------------------------------------------------------------------------------ Date: Thu, 03 May 90 16:51:19 PDT From: "Robert Ching" Subject: test... ------------------------------------------------------------------------------ Date: Thu, 3 May 90 16:57:33 -0700 From: orgass+@rchland.ibm.com testing... ------------------------------------------------------------------------------ Date: Mon, 7 May 90 22:27:42 PDT From: David Goldgerg Subject: speed of compiling After writing a moderate amount of Modula-3 code, I was frustrated by how much slower compiling a Modula-3 program is compared to a C program of comparable size. Of course, some of this extra time is unavoidable, because the Modula-3 code has to first be converted to C and then run thru the C compiler. However, I found that some simple changes that speeded things up. For a moderate sized program (2000 lines spread over 30 Modules), it took about 43 seconds to link. That meant that every time I made a change to one module, I had to go thru the recompilation time for that module plus 43 secs to link. First I discovered that about 10 secs was being spent in overhead in the m3ld shell script (because of the large number of modules). That is, by rewriting m3ld as a C program, I cut the link time down to about 33 seconds. Second, since I was running under SunOs, I converted m3lib.a and m3run.o into shared libraries. This shaved another 8 seconds off the link time, and also made the final binary much smaller. The savings for the "hello world" program in section 5.2 of the User manual were more dramatic. Link time went from 37 seconds to 10 seconds. The size of the binary went from 729088 to 40960 bytes (although much of that was dbx symbols). These changes were all pretty straightforward, but I have some notes on what I did for those who are interested. David Goldberg goldberg@parc.xerox.com ------------------------------------------------------------------------------ Date: Tue May 8 09:39:51 1990 From: rpp386!aubrey@cs.utexas.edu Subject: Unsubscribe Please unsubscribe my account. Sorry about posting. I can't find the list manager name anywhere. ------------------------------------------------------------------------------ Date: Thu, 10 May 90 15:39:59 -0400 From: Ronald G. Minnich Subject: some questions... Subject: fun with m3. OK, two questions to start 1) m3pp gets a NIL dereference error on a SPARC. Ever seen this? Am I doing something simple wrong? 2) How do i go to an arbitrary directory, e.g. test/c01, and get it to make the stuff in there. I know you use imake, but I don't see anything as easy as a simple make Is there? It would sure help! 3) this stuff actually compiles with no errors and mostly runs on a sun3! Nice work! anyone else taken this further. It runs to the point of getting the same type of core dumps (m3pp). thanks, ron ------- End of Forwarded Message ------------------------------------------------------------------------------ Date: Fri, 11 May 90 01:14:56 PDT From: Eric Muller Subject: Re: some questions... > 1) m3pp gets a NIL dereference error on a SPARC. Ever seen this? > Am I doing something simple wrong? No, I did something simple wrong. This will be fixed in release 1.5. (If you are audatious, remove the first argument - 0 - in the calls to _Formatter__xxx near the end of in Parse.yacc). > 2) How do i go to an arbitrary directory, e.g. test/c01, and > get it to make the stuff in there. I know you use imake, but > I don't see anything as easy as a simple > make > Is there? It would sure help! Try ".ROOT/imake/imake base". That's for the tests. For the other directories, ".ROOT/imake/imake" should do it. > 3) this stuff actually compiles with no errors and mostly runs on a sun3! > Nice work! anyone else taken this further. It runs to the point of > getting the same type of core dumps (m3pp). Wonderful. We will add to the documentation that the SPARC configuration is believed to work on Sun 3 machines. Thanks. Eric Muller. ------------------------------------------------------------------------------ Date: Fri, 11 May 90 11:12:10 +0100 From: mjj%computer-lab.cambridge.ac.uk@NSFnet-Relay.AC.UK Subject: gnuemacs Modula-3 mode This used to be distributed with the Olivetti distribution, but it is public domain so I have edited it to conform to both the SRC and Modula-3 conventions. I expect it will eventually find its way into the SRC distribution, but I can mail it or post it to this bb if anyone wants it right now. One neat feature is the ability to point at an interface name in the source and have its source brought up in another window. Right now this is still based on the Olivetti convention of an 'm3path' file rather than an M3PATH environment variable, but my experience with both these mechanisms has convinced me that the former is safer (and its easy to set M3PATH from m3path). Mick Jordan Here is the mode documentation to whet your appetite: Modula 3 Mode: This is a mode intended to support program development in Modula 3. All control constructs of Modula 3 can be reached by typing CNTRL C followed (usually!) by the first character of the construct. There is also a pseudo abbrev mode for Modula 3. Typing the first letter(s) of a construct and then hitting TAB will cause the full construct to be inserted. When there is overlap between two constructs (e.g. WITH and WHILE) type the smallest unique substring (e.g. "wi" for WITH) then hit TAB. If the character before point is not a letter or the preceding word is not a valid abbreviation TAB just inserts whitespace to the next tab stop. If the abbreviation is not unique alphabetic ordering is used e.g. "w" gives WHILE rather than WITH. There are a few mode specific commands which are not to do with inserting text for language structures (e.g. compile module, toggle pseudo abbrev mode). These can be used by typing CTRL-C CTRL-O, "O" (for "Other") and then the command letter. See the following list for more detailed information. C-c Prefix Command TAB m3-abbrev-or-tab C-c } m3-end-comment C-c { m3-begin-comment C-c y m3-import C-c w m3-while-or-with C-c u m3-until C-c t m3-try-or-typecase C-c r m3-record C-c p m3-procedure C-c C-o Prefix Command C-c o m3-object C-c | m3-next-case C-c l m3-loop-or-lock C-c m m3-choose-module C-c i m3-if C-c f m3-for C-c e m3-else C-c d m3-declare C-c c m3-case C-c b m3-block C-c a m3-array C-c C-o p m3-convert-proc-header C-c C-o c m3-compile C-c C-o b m3-toggle-buffer C-c C-o v m3-path-find-file C-c C-o a m3-toggle-abbrev The variable m3-indent controls the number of spaces for each indentation. ------------------------------------------------------------------------------ Date: 12 May 90 12:46 +0200 From: Igor Metz Subject: Re: gnuemacs Modula-3 mode Could you please send me the Modula-3 mode code? Thank you Igor Metz Institut fuer Informatik und angew. Mathematik, Universitaet Bern, Switzerland. domainNet: metz@iam.unibe.ch Phone: (0041) 31 65 49 90 ARPA: metz%iam.unibe.ch@relay.cs.net Fax: (0041) 31 65 39 65 ------------------------------------------------------------------------------ Date: Thu, 17 May 90 17:10:42 EDT From: chittamu@pogo.cs.umass.edu (Satish Chittamuru) Subject: Unable to test target compiler I have installed the target compiler on a DS3100, but am unable to test it. I tried a .ROOT/imake -I.ROOT/imake test in the tests directory. imake runs for a few seconds and then quits. No error messages, no output. The imake description is all greek and latin to me and I haven't been able to figure out what's happening. Could anyone help? The compiler directory has the file m3compiler.target if that's of any help. -Satish. chittamu@cs.umass.edu ------------------------------------------------------------------------------ Date: Sat, 19 May 90 13:42:02 JST From: Kazuaki Maeda Subject: Unsubscribe Please delete my account from M3 mailling list. -------------------------------------------------------------- Kazuaki Maeda E-mail : kaz@ae.keio.ac.jp Department of Administration Engineering Keio University, JAPAN -------------------------------------------------------------- ------------------------------------------------------------------------------ Date: Wed, 23 May 90 12:53:19 EDT From: Ronald G Minnich Subject: pp core dump m3pp.yacc calls Formatter_NewLine with an invalid parameter! The first parameter is 0, and it should a T as defined in Formatter.m3. Did this ever work? I think you m3 folks at SRC should give m3 a little more publicity. For those of us who are sick of C++ this really looks pretty good... ron s ------------------------------------------------------------------------------ Date: Wed, 23 May 90 13:21:58 EDT From: Ronald G Minnich Subject: All the Formatter calls in Parse.yacc were changed THey all had this unnecesary 0 as the first parametner. Is this an Ultrix-ism? Once that 0 was deleted all went well, as long as I use bison and not yacc for the yacc file. m3pp now works fine. ron ------------------------------------------------------------------------------ Date: Wed, 23 May 90 11:08:19 PDT From: Eric Muller Subject: Re: All the Formatter calls in Parse.yacc were changed > THey all had this unnecesary 0 as the first parametner. > Is this an Ultrix-ism? No. We changed a bit the parameter conventions on the C side between 1.2 and 1.4, and I forgot to modify pp. For the record: Since Modula-3 has nested procedures and C doesn't, we have to manipulate frames by hand. In 1.2, all procedures had an extra argument in their C compilation, to hold the display pointer; this is what the 0 is. In 1.4, only local procedures have such an argument. This leaves most of the procedures with the same argument list in Modula-3 and C, and thus makes debugging easier. There is another case where we have to add an extra argument: procedures that return structures (pcc does not generate reentrant code in that case and this is a problem in the presence of threads); we do essentially what gcc does in that case. > Once that 0 was deleted all went well, as long as I use bison and > not yacc for the yacc file. Yes, the grammar is rather complicated and standard yaccs are not big enough. We use a version that has larger tables. In 1.5 and following, we will provide the output of you yacc, as well as the input. Thanks for your interest in Modula-3, Eric Muller. ------------------------------------------------------------------------------