HDTenEightyP/NetNews huggingface dataset:
From: dmb@usl.edu (David M. Brumley)
Subject: Re: Dynamic arrays in Modula-2?
Organization: Univ. of Southwestern Louisiana
Date: Fri, 17 Apr 1992 14:27:30 GMT

lins@Apple.COM (Chuck Lins ) writes:

>Since Guenter Dotzel showed how to do dymanic arrays in ISO Modula-2 I
>guess I should demonstrate the way it's done in Oberon(-2). The symbol
><type> shall be a metasyntactic entity representing any type.

>MODULE Quux;

>TYPE
>	OpenArray = POINTER TO ARRAY OF <type>;
>VAR
>	myArray : OpenArray;

>BEGIN
>    NEW(myArray, 100); (* for an array of 100 elements *)

>    (* use the array; e.g. *)
>    myArray[5] := <variable of <type>>;

>    (* when done using the variable you will want it garbage collected *)
>    myArray := NIL;
>END Quux.

>That's all there is. In Oberon(-2), these array are called "open arrays"
>to distinguish them from the dynamic arrays used in paramater passing.

THAT's what I was looking for.  The previous responses to my question
have, I think, confirmed the existence of a flaw in the design of
Modula-2.  Modula-2's inability to handle "dynamic arrays", by which I
mean arrays whose dimensions are not known at compile time, without
the support of a nonstandard user defined datatype is extremely
frustrating.  This flaw discouraged me from using Modula-2 in a
graphics project, which I'm now writing in C for lack of a better
alternative.  I am, however, examining DEC's Modula-3 language which
seems to lack the shortcomings of Modula-2 as well as provide lots of
new features including objects, threads, and garbage collection.
From: Changhao_Boh@mindlink.bc.ca (Changhao Boh)
Newsgroups: comp.lang.modula2
Subject: Re: Dynamic arrays in Modula-2?
Date: 10 Apr 92 11:06:04 GMT
Organization: MIND LINK! - British Columbia, Canada
Distribution: world

DM> Sorry, I tried to say in the second paragraph above that the dimension
DM> of the array are not known at compile time.  I assume (for now) that
DM> the number of dimensions is known.  I guess I should have said
DM> "dynamic declaration" instead of "dynamic allocation."

Well, the answer is still user defined data structures.  Use an opague datatype
to simulate a multidimentional array.  If you are looking for Quick BASIC's
REDIM, I don't thing you'll find it in Modula 2.  Afterall, isn't that why we
all have to go thru the data structure course ? To learn about the wonderful
world of dynamic datatypes.

Yup, you cannot get away from POINTERs.

Good Health.

Changhao
From: eepjm@wombat.newcastle.edu.au (Peter Moylan)
Subject: Why C remains popular
Organization: University of Newcastle, AUSTRALIA
Date: Mon, 6 Apr 1992 05:57:38 GMT

Recently I posed the question "Why do so many people like C" to this
group.  (Of course I could have had a larger response by posting to
a C group, but I didn't want to start yet another flame war.)  I
think that the question is important because it helps in answering
the next question: How could we go about making Modula-2 (and/or one
of its successors) more popular?

I got three responses.  Not many, but still enough to make a summary
worthwhile.  Thanks to Larry Maturo, Syed Shibli, and Michel Dagenais.
An edited version of their comments follows, after which I have some
more comments.

-----------------------------------------------

- you can get a clean compile much quicker than you can in a strongly
  typed language and then you can design and implement your program
  incremently.
- much larger standard library than Modula-2 [and various other
  languages].
- strongly typed languages are more maintainable, but at the price
  of requiring more up-front design work.  [...] program design is
  something that requires a lot of experience to do well without
  coding as you go, so for inexperienced programmers that are forced
  into doing design C is easier.
- very terse syntax
- argv and argc
- availability of high-quality cheap compilers.
- very portable
- everyone else is using it
- lots of third-party libraries
- more powerful/flexible than Fortran
- more flexible/portable than Pascal (pointers to functions...)
- UNIX is built in C for C programmers

[End of summary]
-----------------------------------------------

Now, I don't agree with all of these points, but that's a separate 
issue.  What we have here is the beginnings of a list of the ways
in which Modula-2 could be made more attractive and/or better
promoted.  I'd suggest that standards and portability need to be
at the top of the list.

Side comment: I am now in the middle of writing up a document
called "Why I hate C", so that the next time I get caught up in the
endless disputes I can simply hand out a few sheets of paper rather
than repeating the same old arguments.

By the way, some of you will enjoy the following comment by one
of the respondents:
"Then, with the advent of C++, i gave it a try but at some point 
i could not stand it any more. Some OO facilities were added but at an
incredible cost in complexity and without much more safety or
structuring facilities.  I am now an happy MODULA 3 convert."

-- 
Peter Moylan                      eepjm@wombat.newcastle.edu.au
From: garym@castle.ed.ac.uk (Gary Martin)
Newsgroups: comp.lang.modula2
Subject: Amiga Oberon
Date: 10 Apr 92 16:09:07 GMT
Organization: Edinburgh University

Some one was asking about an Oberon compiler for the Amiga a few days
back.  I don't know what version is currently being supported as I'm
playing with a 1990 demo version.  The system feels sturdy, nice
integrated editor with syntax check ect and very fast.  Coded by
Fridtjof Siebert, check you can get a full English version - demo has
German Error messages (ARGH!). 

Full versions are available from:-  	A+G AG
					Im Daderiz 61
					CH - 2540 Grenchen
					Switzerland

Hope this helps out, Gary.
From: wang#m#_hao-yang@MSGATE.CORP.APPLE.COM ("Wang, Hao-Yang")
Newsgroups: comp.lang.modula2
Subject: 1)Oberon-2 Read Only Var; 2)Concurrent GC
Date: 7 Apr 92 22:31:54 GMT
Article-I.D.: internal.9204072208.AA14964
Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@cmsa.Berkeley.EDU>
Organization: The Internet

In Oberon-2, variables can be exported as 'read-only' (by adding "-" instead of
"*" in its declaration).  What constraints are imposed on the usage of this
kind of variables while being imported?  Surely it cannot appear on the left
side of an assignment statement.  But can it be passed as a VAR parameter to a
procedure?

Why is the garbage collector a hindrance to the real time applications?  In the
implementation to the run time environment, we can make the garbage collector
as a concurrent process to the 'garbage producer', and find some way to ensure
that the garbage producer does not produce garbage faster than the garbage
collector can consume.  Are there any real language implementations using this
kind of approach?  (Maybe some Ada implementations?)

Hao-yang Wang
From: lins@Apple.COM (Chuck Lins )
Newsgroups: comp.lang.modula2
Subject: Re: Re^2: Dynamic arrays in Modula-2?
Summary: How it's done in Oberon
Date: 17 Apr 92 02:03:26 GMT
Article-I.D.: apple.65564
Organization: Apple Computer Inc., Cupertino, CA

Since Guenter Dotzel showed how to do dymanic arrays in ISO Modula-2 I
guess I should demonstrate the way it's done in Oberon(-2). The symbol
<type> shall be a metasyntactic entity representing any type.

MODULE Quux;

TYPE
	OpenArray = POINTER TO ARRAY OF <type>;
VAR
	myArray : OpenArray;

BEGIN
    NEW(myArray, 100); (* for an array of 100 elements *)

    (* use the array; e.g. *)
    myArray[5] := <variable of <type>>;

    (* when done using the variable you will want it garbage collected *)
    myArray := NIL;
END Quux.

That's all there is. In Oberon(-2), these array are called "open arrays"
to distinguish them from the dynamic arrays used in paramater passing.


-- 
Chuck Lins, Apple Computer, Inc. Oberon-2 Paladin  lins@apple.com
Searching... Searching... Searching for Solevig Dommartin
From: Ralph.Kringhs@f27.n295.z2.fidonet.org (Ralph Kringhs)
Newsgroups: comp.lang.modula2
Subject: Pragma and inline assembly
Date: 5 Apr 92 01:35:10 GMT
Article-I.D.: puddle.13996.29E2857E
Organization: FidoNet node 2:295/27 - Horse Power, Antwerpen B

Yes, you can use straight Assembler stuff in Modula-2.
The system provided for it are CODE procedures. They look like this :

PROCEDURE WhatEver (Aparam : AnyType)
BEGIN
CODE
  <state your assembler here)
END WhatEver ;

A second method is to put the assembler into an array of byte
and jump to it.



--  
uucp: uunet!m2xenix!puddle!2!295!27!Ralph.Kringhs
Internet: Ralph.Kringhs@f27.n295.z2.fidonet.org
From: lins@Apple.COM (Chuck Lins )
Newsgroups: comp.lang.modula2
Subject: Re: 1)Oberon-2 Read Only Var; 2)Concurrent GC
Date: 10 Apr 92 16:27:31 GMT
Organization: Apple Computer Inc., Cupertino, CA

In article <9204072208.AA14964@internal.apple.com> Modula2 List <INFO-M2%UCF1VM.BITNET@cmsa.Berkeley.EDU> writes:
>In Oberon-2, variables can be exported as 'read-only' (by adding "-" instead of
>"*" in its declaration).  What constraints are imposed on the usage of this
>kind of variables while being imported?  Surely it cannot appear on the left
>side of an assignment statement.  But can it be passed as a VAR parameter to a
>procedure?

No. The variable is read-only.

>
>Why is the garbage collector a hindrance to the real time applications?  In the
>implementation to the run time environment, we can make the garbage collector
>as a concurrent process to the 'garbage producer', and find some way to ensure
>that the garbage producer does not produce garbage faster than the garbage
>collector can consume.  Are there any real language implementations using this
>kind of approach?  (Maybe some Ada implementations?)
>

There has been much work in the area of concurrent garbage collection. Papers
by Hans Boehm (now of Xerox PARC) come to mind, as well as Andrew Appel.
There are others as well. Not impossible to do, but sometimes very hard
rela time constraints (eg interrupts from device X must be handled within N
microseconds) where if you're in the middle of GC may be difficult to handle.

-- 
Chuck Lins, Apple Computer, Inc. Oberon-2 Paladin  lins@apple.com
Searching... Searching... Searching for Solevig Dommartin
From: mcintosh@ccwf.cc.utexas.edu (aubrey mcintosh)
Newsgroups: comp.lang.modula2
Subject: Dynamic arrays in Modula-2?
Date: 9 Apr 92 22:57:46 GMT
Organization: University of Texas, chemistry dept.

> From: dmb@srl03.usl.edu (David M. Brumley)
> Date: 9 Apr 92 22:57:46 GMT
> Message-ID: <DMB.92Apr9165746@srl03.usl.edu>

> How does one express dynamic allocation of single and
> multi-dimensional arrays in Modula-2?  How does one pass a dynamically
> allocated multi-dimensional array as an argument to a procedure?
> 
> My references on Modula-2 lead me to believe that this elementary
> operation is difficult or impossible to solve elegantly or portably in
> Modula-2.


I have a general matrix arithmetic package that may interest you.  It may
be ftp-ed from 
     titania.mathematik.uni-ulm.de:
     /pub/soft/oberon/ethz/contrib/Matrix/Matrix.tar.Z

This package was initially written PIM2 conformant under the Logitech 
compiler, and with minor changes was ported to the Oberon operating 
system. It should read easily for a Modula-2 programmer.

Some relevant code is:

  TYPE
    Real = RECORD
      value: REAL;
      lastPosition: INTEGER;
      exact: BOOLEAN;
    END ;

	TYPE
		Matrix* = 
			RECORD
				dimensions* : ARRAY 2 OF INTEGER;
				values*		: POINTER TO ARRAY Maxarray OF Natural.Real;
			END;

	PROCEDURE Create*
					(		frows, fcolumns : INTEGER;
						VAR result : Matrix );
	BEGIN
		result.dimensions[0] := frows;
		result.dimensions[1] := fcolumns;
		SYSTEM.NEW( result.values, frows * fcolumns * SIZE( Natural.Real ) )
	END Create;
-- 
Aubrey McIntosh  /  Chemistry  /  University of Texas  /  Austin, TX 78712
..another Gaelic learner...
From: g_dotzel@tron.gun.de (Guenter Dotzel)
Newsgroups: comp.lang.modula2
Subject: Re^2: argc and *argv in Modula-2 ?
Date: 10 Apr 92 07:00:04 GMT

Brian.Gates%p0.f341.n280.z1.fidonet.org@USENET.ZER wrote on Thu, 04-02-1992 at 04:12 h
under the subject 'Re: argc and *argv in Modula-2 ?':

> *** Quoting Terenas S D M to All ***
>  TSDM> Is there a way of passing parameters from the Command Line into a
>  TSDM> Modula2 program ?  An example,
>  TSDM> 
>  TSDM> mod_copy file1 file2.  
>  TSDM> |       |     |
>  TSDM> |       |     +--- 2nd Parameter
>  TSDM> |       +--- 1st Parameter
>  TSDM> +--- Program name
> 
> Is there a standard way?  I'm not too sure.  The way I accomplish it
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             Yes, there is a Standard way! See my previous message(s)
             with an example using the ISO M2 Standard I/O-Lib!
             
             You make me believe, that my messages posted to this newsgroup
             aren't received on the other side of the ocean!
             
             Cheers, 
             G~unter Dotzel, ModulaWare GmbH, Erlangen/Germany.
             Email: g_dotzel@ame.nbg.sub.org
From: Changhao_Boh@mindlink.bc.ca (Changhao Boh)
Newsgroups: comp.lang.modula2
Subject: Re: Dynamic arrays in Modula-2?
Date: 10 Apr 92 04:06:30 GMT
Organization: MIND LINK! - British Columbia, Canada
Distribution: world

DM> How does one express dynamic allocation of single and
DM> multi-dimensional arrays in Modula-2?  How does one pass a dynamically
DM> allocated multi-dimensional array as an argument to a procedure?
DM>
DM> For example, if a two or three dimensional array of INTEGERs resides i
DM> file on disk, and the dimensions of the data set are specified at the
DM> beginning of the file, how can the file be loaded and manipulated
DM> using a Modula-2 program?
DM>
DM> My references on Modula-2 lead me to believe that this elementary
DM> operation is difficult or impossible to solve elegantly or portably in
DM> Modula-2.

Via user defined datatypes, sir, user defined datatypes, user defined
datatypes.

You'll have to write your own opaque data sturctures to accomplish what you
want.

To begin,

TYPE
  MultiDimArray   = ARRAY [1..100] [1..100] [A..Z] OF CARDINALS;

  aMultiDimArray  = POINTER TO MultiDimArray;

VAR
  Array : aMultiDimArray;

BEGIN
  ALLOCATE(Array, SIZE(Array^));

  (* Do your stuffs... *)

  DEALLOCATE(Array, SIZE(Array^));

END.


Good Health.

Changhao.
From: andrea@ESSEX.STFX.CA (John Andrea)
Newsgroups: comp.lang.modula2
Subject: Re: Modula-2 in the real world (was: See Summary! M-2 discus
Date: 16 Apr 92 14:26:45 GMT
Article-I.D.: esseX.00959301.01784F80.28416
Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@cmsa.Berkeley.EDU>
Organization: The Internet

>Would I use a GNU Modula-2 for Unix ?
Sure, it would be nice to have a compiler for the other unix boxes on campus.
As far as whats provided by University Computer Services, we've got the
DEC Western Research Labs Modula-2+ compiler for Ultrix  NOW!
And a Modula-3 is available too.

Perhaps DEC-WRL could be convinced to make their compiler available for more
generic Unix(tm).

There are commercial Modula-2 compilers available for Unix. Unfortunately
i don't think that its just the cost thats keeping M2 from being popular.


another modulan, Changhao writes:
>A good and modern implementation of a M2 compiler should have the following
>  a.  Integrated Developmnet Environment.
>  b.  Uses various GUI aviable on the Unix interactively.
>  c.  Good On-line help with examples.
>  d.  Good M2 modules, especially for InOut and SYSTEM, to interface
>      with the underlying Unix system.
>  e.  Reasonable optimization...

I don't entirely agree that an IDE is required. On a Unix system i want to
collect the tools that are familiar/useful to me and put them together as i
see fit. In my eyes this is a few X11 windows with a compile happening in one,
a windowing edit in another, and a few more.
Good on-line help with examples. Perhaps a good textbook is whats really
required, and implementations that don't deviate from PIM2 (till an ISO
standard is ready).
As for examples, perhaps you should contact the head of the CS department and
the computer center. I see it as part of my job to provide help/examples with
the software on the machines that i support at this institution.




John Andrea,   VAX System Manager
St.Francis Xavier University
Antigonish, Nova Scotia, Canada   B2G 1C0
email: andrea@essex.stfx.ca
From: ob@IFI.UIB.NO (Ole-Bjorn Tuftedal)
Newsgroups: comp.lang.modula2
Subject: News about the new Logitech Modula-2 V 4.0 Development System
Date: 15 Apr 92 11:27:07 GMT
Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@cmsa.Berkeley.EDU>
Distribution: world
Organization: The Internet

The new Logitech Modula-2 V 4.0 Development System with MultiScope.

We recently received upgrade information from TERRA Datentechnik, the
European distributor of Logitech / MultiScope.   As reported earlier by
several people, the new Logitech Modula-2 is an adapted version of the
StonyBrook compiler. It supports Windows 3.0/3.1 programming and is shipped
with the language independent MultiScope DOS and Windows debugger and a new
fast linker OPTLink.

The integrated development environment WorkShop is based on the Point editor
v. 3, and is available for DOS and Windows.  It contains a help system that
gives information on all identifiers in the library.  The library includes
VGA graphics, Netbios access and DOS environment.

Utilities include M2Make, M2Check, M2Vers and M2Import (tracks imported
identifiers and generates import list).  M2Convert converts code from V 3.4 to
V 4.0.

In the Windows version files may be "dragged" to the specific icon to be
edited, compiled etc.

TERRA also supplies a support disk containig various additional information,
a complex Windows programming example, graphics programming examples and more.

Prices:
Full system:                       720 SFr,    about   475 USD
Upgrade from V 3.4                 265 SFr,    about   175 USD

Sidegrade from JPI or StonBrook    265 SFr,    about   175 USD
Sidegrade from any Pascal compiler 265 SFr,    about   175 USD

If anyone has tested the system, please post your experiences to the net.
We will place our order shortly and will be back when we have done  a bit
of testing ourselves.


You may contact TERRA by telephone:  +41 1 910 3555
                         fax:        +41 1 910 1992
                         mail:       TERRA Datentechnik
                                     Bahnhofstr. 33
                                     CH-8703 ERLENBACH
                                     Switzerland


Greetings from
Ole-Bjorn Tuftedal

Dept. of Information Science
University of Bergen, Norway

tuftedal@ifi.uib.no
From: bmr@reef.cis.ufl.edu (Benedict Rafanello)
Newsgroups: comp.lang.modula2
Subject: Re: Trying to find JPI - TopSpeed Modula-2 for DOS
Date: 14 Apr 92 17:18:05 GMT
Reply-To: bmr@reef.cis.ufl.edu (Benedict Rafanello)
Organization: U of Florida. Computer Science Dept.

In article <4558@m1.cs.man.ac.uk>, lilleyc@cs.man.ac.uk (Chris Lilley) writes:
|> In article <1992Apr8.152225.4585@csc.canterbury.ac.nz> cctr132@csc.canterbury.ac.nz (Nick FitzGerald, CSC, Uni. of Canterbury, NZ) writes:
|> 
|> >As the subject line suggests, I'm trying to track down Jensen & Partners
|> >International - JPI - the (former ?) publishers of the TopSpeed Modula-2
|> >compiler for DOS.
|> 
|> >We bought several copies of the TopSpeed Modula-2 compiler direct from
|> >JPI about a year ago, and upon trying to contact them the other day, we
|> >were told the phone number we had didn't exist and the International
|> >Tolls Operator wasn't able to find a dirctory entry for JPI.
|> 
|> >Can anyone who knows please tell me:
|> 
|> >1.  Are JPI still in business?  If so, where?  How do we ring them?
|> 
|> >2.  If they are not in business, did they sell TopSpeed Modula-2 to some
|> >other company?  If so, who?  How do we ring them?
|> 
|> As far as I am aware, JPI were bought out by Claris. I guess they had been
|> in trouble for a while; their earlier flashy adds had been replaced by
|> smaller, cheaper, less colourfull ones for about 8 monthe to a year
|> beforehand.
|> 
|> I don't recall whether Claris (I think it was Claris...) was going to
|> continue supporting JPI products - I recall that they wanted the technology
|> themselves for their own products, databases and stuff...
|> 
|> Does anyone remember better? Actually I am not sure about the company name
|> it could be Clarion or something - some company I didn't associate with
|> compilers, anyhow.
|> 
|> 	Chris

As of January '92, JPI was still in business.  They moved to somewhere in
the north east, maybe New Hampshire.  I don't have my JPI stuff here right
now, but I will try to get you there number and current address.

Last I heard, they had announced 32 bit versions of all their compiler
products for OS2 V2, and had just brought out their own DOS extender (written
in Modula-2), and their products were recently reviewed by some of the
programmer magazines, like Computer Language, PC Techniques, Dr. Dobbs, etc.
I forget which one it was, but one of the computer magazines picked their 
C++ compiler over both Borland's and Zortech.  I think the deal with Claris was
for access to some of JPI's technology, or to get JPI to develop a compiler for
them or something.  I'll see what I can find out.

Ben
From: bmr@thedog.cis.ufl.edu (Benedict Rafanello)
Newsgroups: comp.lang.modula2
Subject: Re: argc and *argv in Modula-2 ?
Date: 6 Apr 92 16:13:54 GMT
Article-I.D.: uflorida.34995
Reply-To: bmr@thedog.cis.ufl.edu (Benedict Rafanello)
Organization: U of Florida. Computer Science Dept.

In article <23U676368B@tron.gun.de> g_dotzel@tron.gun.de (Guenter Dotzel) writes:
 
 >MODULE mod_copy;
 >FROM ProgramArgs IMPORT IsArgPresent, ArgChan;
 >FROM IOResult IMPORT ReadResult, ReadResults;
 >FROM TextIO IMPORT WriteString, ReadToken, SkipLine, ReadString;
 >
 >TYPE fnam = ARRAY[0..254] OF CHAR;
 >VAR from, to: fnam;
 >
 >BEGIN
 >  IF (ReadResult(ArgChan()) <> endOfInput) THEN ReadToken(ArgChan(), from);
 >    IF (ReadResult(ArgChan()) <> endOfInput) THEN ReadToken(ArgChan(), to);
 >    ELSE (* ... *)
 >    END;
 >  ELSE (* ... *)
 >  END;
 >END mod_copy.

I certainly don't like the look of this!  I would prefer to get the command line
as a single string which I can parse myself.  This is the approach taken by
Stony Brook.  Their library has a procedure, I believe its called GetCommandline,
which returns the command line for the program as a string.  While parsing the
command line yourself may be more work, I think it is more flexible than the
approach above, unless I am missing something.

Ben
From: d9mikael@dtek.chalmers.se (Mikael Wahlgren)
Newsgroups: comp.lang.modula2
Subject: Re: Trying to find JPI - TopSpeed Modula-2 for DOS
Date: 10 Apr 92 15:19:46 GMT
Organization: Chalmers University of Technology

>Try going back a few messages, there was a very similar question some days
>ago with the new US address.

Yes, JPI is definitely still in business.  It seems that the mere fact that
JPI moved it's US office from the US west coast, to East in US, is ground
enough to get this rumour around.

>|> Does anyone remember better? Actually I am not sure about the company name
>|> it could be Clarion or something - some company I didn't associate with
>|> compilers, anyhow.

>Clarion, Clarion, not Claris! Not bought up, but talks of merger.
>Could make a killer product, see comments in Byte a few issues back.
>Clarion is in database, 4th generation application generators.
>Supposedly JPI would extend their compiler technology to Clarion,
>and would gain database tecnology in return.

JPI and Clarion is working on a merger.  If the original poster didn't 
associate Clarion with compilers, that's his loss.  Clarion is a very
popular (over here anyhow) 4th generation database application
generator.  The merger with JPI means that Clarion will be using
the JPI code generator and optimizer, and that you will be able to 
interface between the TopSpeed compilers and Clarion in a simple
way.

Mikael Wahlgren      d9mikael@dtek.chalmers.se
Newsgroups: comp.lang.modula2