Path: utzoo!mnetor!uunet!husc6!mailrus!nrl-cmf!ames!ncar!noao!arizona!lm From: lm@arizona.edu (Larry McVoy) Newsgroups: comp.arch Subject: Re: FORTRAN Horror Message-ID: <4584@megaron.arizona.edu> Date: 29 Mar 88 23:23:39 GMT References: <1135@pembina.UUCP> <46500011@uxe.cso.uiuc.edu> <6630@ames.arpa> Reply-To: lm@megaron.arizona.edu (Larry McVoy) Organization: University of Arizona, Tucson Lines: 58 In article <6630@ames.arpa> lamaster@ames.arc.nasa.gov.UUCP (Hugh LaMaster) writes: >2) Fortran is modular. Fortran subroutines are modules, and this puts >Fortran ahead of any language (e.g. Pascal) which only has "procedures". >Yes, both would be better. Unfortunately, I haven't seen any vectorizing >Modula-2 compilers for the Cray or CDC machines. Convex does sport a >vectorizing C compiler, however. Umm, I'll throw in a penny here: C has modules. Note that the following example defines an abstract data type, operations on the data type, but implies nothing about how the operations work, data storage, etc. (Actually, whomever makes "stack.h" defines the type, but that's a red herring.) So C gives you all of mod-2 with none of the pain. So what we need is a vectorizing C compiler, right? 1/2 :-) Seriously, please don't hold up Mod-2 as an example of a good programming language. Mod-2 sucks donkey noids is my experience after looking at big systems written in it. Here's the example, if anyone cares: ---- begin stack.c ------ /* * stack.c - dummy C module for netnews example */ # include "stack.h" /* defines stack_t */ # include # define STACK_MAX 100 /* hidden */ static stack_t stack[STACK_MAX]; /* hidden */ static int indx = 0; /* hidden */ /* * push - push a copy of the item */ int push(s) stack_t s; { /* exported */ if (indx < STACK_MAX-1) { stack[++indx] = s; return 0; } return -1; } /* * pop - return a copy of the stack top, pop. */ stack_t pop() { static stack_t null; /* zero-ed for error return */ if (indx > 0) return stack[--indx]; return null; } ----- end stack.c ------ -- Larry McVoy lm@arizona.edu or ...!{uwvax,sun}!arizona.edu!lm