[Beowulf] g77 limits...

Jim Lux James.P.Lux at jpl.nasa.gov
Fri Feb 24 07:23:05 PST 2006

At 10:06 PM 2/23/2006, Robert G. Brown wrote:
>On Thu, 23 Feb 2006, Greg Lindahl wrote:
>Some are stricter, do more type checking, protect the programmer against
>their own mistakes, force the programmer to use a style that can be
>automatically optimized for them at the compiler level more easily,
>match up better to "formula translation" or some other desired base
>procedural/object oriented/list oriented paradigm.  And I don't mean
>just fortran -- C++ has many of these advantages as well.  Pascal was
>downright fascist about types and declarations, the two or three times I
>coded toy projects in pascal before I ran from the room screaming Sieg
>Heil and burned my pascal manual as the object of demonic mind control
>that it was.

If you liked Pascal, then you'd love Ada..  Ada had real potential for a 
while, forced good design with very strong typing, but couldn't evolve fast 
enough to accommodate all the weird and wonderful things going on the C 
world.  It also prevented you from doing all those nifty little tricks 
{like doing an entiire sieve of Erastothenes in a for();}, all in the name 
of producing code without side effects.  In C (or assembler) you've got the 
freedom to perform a task in dozens of ways, each of which has slightly 
different side effects.  In Ada (or, really, Pascal, from which it's sort 
of derived), there is usually one, and only, one way to do something.

There was even a stripped down microcomputer version of Ada (Janus) which I 
loved, but it died. Janus couldn't be called Ada, because it didn't support 
the full language, and hadn't passed the DoD validation suite, but it was 
Ada, nonetheless, and it was wonderful for having all the nice object 
oriented stuff (overloading, etc.), dynamic memory allocation (but with 
guaranteed safe pointers), and it made halfway decent executables.  Ada has 
the unfortunate association with the DoD, too.  There was a surprising 
amount of resistance on the part of some coders from working in a language 
developed by and for "imperialist war mongers".  {Bizarre fantasy: Imagine 
Richard Stallman advocating for Ada, based on it's elegance}

>Then there are languages -- well, there is C -- with LESS of all of the
>above -- less strict rules, more freedom, more danger to the programmer,
>more accessible power, harder to optimize at the compiler level, perhaps
>easier for the USER to optimize as there isn't a lot of room between C
>and assembler.

Long live Iverson's "A Programming Language"...funky keyboard and all.  I 
spent a happy summer grinding out APL code on IBMs first "portable personal 
computer" (the 5100).  (IBM's first "personal" computer, as in intended to 
be used by one person, at a time, by that person, was probably the 1130)

>That is, the way most people REALLY choose the language used to program
>any given problem is to consider:
>a) the languages they know -- very few people will willingly learn a new
>language to solve a problem if they think there is ANY way they can
>solve it in a language they already know, for obvious reasons;
>b) the ones they have available -- if APL is your very favorite language
>and perfectly suited to a problem, you're SOL these days. [Well,
>actually you aren't, according to google -- even APL is still alive and
>kicking and available, build ready in (of course) C-source form for
>linux.  Whoda thunk it?];

Why not?  Forth lives on in some sort of diagnostic modes in Apples

>I don't have to do such a survey -- I'm surrounded by dozens of people
>just like this, awash in a sea of fortran legacy code, most of whom
>never took the step that I took and actually learn a second (and third,
>and fourth, and...) language. Lots of them have literally never coded in
>anything else, not even as undergrads.

I'd say that, today, for engineers(based on ECPs - our new buzzword for 
freshouts: Early Career Professionals) more and more of that experience is 
in "C" (not C++, but K&R style C), probably for the same reasons as you 
identify.. their advisor/professor/whathaveyou happened to have a stack of 
C code that needed modifying, using, etc.  The FORTRANites are all starting 
to have a bit of grey in their remaining hair/beards.   These days, a task 
might be to write a C wrapper for a legacy FORTRAN program.

>BTW, although I myself have programmed in many, many languages --
>including applications that are completely unsuited for it in good old
>APL -- I will freely admit that I have done my damnedest to reduce the
>ones I actually use to three -- C for "real programming" of any sort,
>perl for sophisticated scripting or C-lite programming, and bash
>(because if you do any sysadmin at all you cannot avoid it).
>I can intellectually recognize that fortran has (finally) evolved to
>where it isn't as nightmarish as it was when I abandoned it, that maybe
>by now it is a pretty good language. That it was nightmarish is pretty
>clear -- it has changed far more than e.g. C has changed over the same
>time period, and a lot of fortran's changes have been to steal
>constructs from C that were obviously missing in the language and
>obviously necessary.

Hmm.. though.. if you had a FORTRAN code that "worked" and did part of what 
you needed (say 50%)... you'd be on that cusp of modifying the FORTRAN, 
trying to libraryize it (so you can mix the two), or rewriting in C/C++.

This kind of thing comes up more frequently than I'd like.  I don't really 
do software development for a living any more, but still use it. 
{Describing it to a friend, it's like a general contractor who started as a 
carpenter.. these days, most of his job isn't hammering nails and sawing wood}

  So you have this nifty program that does part of what you need, written 
in, for example Visual Basic.  Do you recode it in straight C (and give up 
the user interface features), or in Visual C++ or .NET.  It was maybe the 
work of a couple weeks to generate the original one, and you're looking at 
maybe 3 or 4 days to rewrite it (after all, you've got the design and 
underlying algorithms done, already) or maybe a day to try and find the 
development environment and install it to modify the old one.

It's that "labor hours to complete today's/this week's task" thing.

>However, the REAL reason I stick with C/perl/bash, and eschew python,
>and avoid csh, and no longer code -- much -- in awk, and shudder at
>pascal, and won't touch C++ or fortran, and run screaming at the thought
>of learning lisp is that I'm >>good<< at coding in C and don't >>have<<
>to use anything else to do the work that I need to do.  Ditto perl vs
>python -- I can code "anything" in perl.  What more than anything can
>python code?

These days, Matlab is my friend, although I realized in the course of this 
discussion that I basically code in FORTRAN/BASIC/APL style (i.e. data 
structure-less) in matlab.  Maybe it's that the problems I'm solving in 
matlab are short, and don't require complex data structures.  Or, gods 
forbid, my brain formulates the algorithms to solve the problem in 
FORTRAN.  Niklaus Wirth may have been right, vis a vis ruined minds.

It's probably the magnitude of the problem.  For bigger problems, c and vb 
get used, and both have structures (thankfully) and dynamic memory allocation.

>It has nothing to do with the merits of the language, really.  We code
>in what we know best, until "forced" to do otherwise by some real
>inadequacy in the language (as I encountered in fortran vis a vis C long


More information about the Beowulf mailing list