[Beowulf] g77 limits...

Robert G. Brown rgb at phy.duke.edu
Tue Feb 28 05:59:13 PST 2006


On Tue, 28 Feb 2006, Jeremy Baker wrote:

> I've read the preceding posts and wonder what should be the first three
> languages that I might study from a general perspective? Perhaps I should
> approach three contrasting languages, and I surmise Fortran and C represent
> contrast? What type of Fortran would be a good start? Reference was made to
> many types of languages, I tried to glean what I could, but being a
> greenhorn to CS I was not able to recognize which codes were derivatives.
> Any advice or suggestions?

Oh, I'm full of advice here...

First a disclaimer.  You question has so many answers there is no
answer.  All that any replies can do is help you make choices.

Now that I've gotten that out of the way... let me tell you what to
do and ignore all those others who will reply.  Hah!  What do THEY
know...:-)

Seriously -- I don't know what "a general perspective" means, so let me
make a short list of languages to study depending on what you want to
get out of them.

If you are interested in operating systems or general purpose
application development on linux boxes, learn C, C, C and C.  C was
co-invented by the same people that invented Unix (sorta) and the two
have co-developed ever since.  The kernel is in C (for any unix you
could name, pretty much).  The basic unix toolset is in C.  Device
drivers are in C.  At a guess, 90% of the application code base in e.g.
Fedora Core or Centos is in C, with some honorable mention apps in LIST
and C++ or scripting languages.  If you are feeling adventurous or long
for structure and protection from the harshnesses of C, you can always
tack C++ on top of C, but start with C or you'll never learn about
pointers and raw structs as you get lost in classes and the "C++ way".

If you are interested in doing numerical stuff, you will probably want
to learn Fortran first (however revolting the idea as it SUCKS for doing
"real application" development, I'm sorry, no real apologies to fortran
enthusiasts out there).  However, as Greg has pointed out Fortran
compilers are marginally more efficient than C compilers for numerical
code, there is a HUGE numerical code base in fortran, lots of numerical
libraries with a fortran interface, and honestly for certain classes of
numerical application it is well suited.  C and/or C++ are also
increasingly used for numerics though (the Gnu Scientific Library has a
C interface), and unless you are serious about doing lots of scientific
coding you're probably better off doing C or possibly C++ first instead.

If you are less concerned about existing application code or operating
systems, and just want a language that is well-structured and friendly
to developing NEW applications, C++ is a good choice.  If you learn it
first, you will be mystified by a lot of C code, but people who learn it
first tend to be perfectly happy with it and often never bother to learn
C.  It is well-suited for application development where the tool works
with data structures that can be thought of as "objects" that can be
created, destroyed, and manipulated according to certain rules.  It is
somewhat less well-suited (in my opinion, mind you, others would argue)
to writing "procedural" code where the data objects are simple and
straightforward (e.g. numerics where Fortran rules with C/C++ coming in
second).  Its rules also form something of a straightjacket -- your
protection and structure come at a small price in creativity,
unless/until you learn BOTH C and C++ and can use the embedded power of
C in your C++ code, breaking the rules as it were.  I think it is
much easier to learn C++ first, but probably better overall to really
mastet C and then move on to C++.  But some people who reply (who
generally followed this latter path) are better qualified to remark on
this.

These three are the only compilers I'd advise learning.  There are other
interesting choices, sure, but very small code bases and much more
specialized application spaces for any of them, and I'd honestly suggest
that you start with just one based on what your needs are and the
descriptions above.

However, I'd strongly suggest that you learn at least one scripting
language from the choice of perl and python.  The question of which one
is best is an open invitation to Jihad, so I will avoid it.  perl is the
more C-like of the two -- good for procedural programming, a LOT of the
language syntax and library calls are thin wrappers on top of the C
calls, but it has significant enhancements, e.g. inline regular
expression parsing.  python is the more object-oriented of the two (and
more structured) with somewhat fascist rules for writing the actual
code (but much protection gained from following them).  There are tons
or very useful applications written in both.  You can do web-apps (CGI)
in both.

java would be (in my opinion) a distant third choice because of the
encumbrances and general PITA associated with putting the language
interpreter on a machine -- java is only "pseudo"free code as Sun keeps
it pretty strictly controlled and Microsoft is in a constant war with
Sun to try to co-opt it or replace it.  There is plenty of code written
in it, nonetheless, including a smattering of numerical code.  If you
are interested in web-development it, or a perl-like OPEN SOURCE OPEN
STANDARD language called PHP are not terrible choices, php WAY before
java.

bash programming is always useful if you're interested in doing sysadmin
work or systems programming as opposed to numerical or application
programming.

So I'd recommend some pattern like:

[Fortran,perl,bash]  (numerical focus, unstructured, some systems)
[C,perl,bash] (general purpose, unstructured, lots of systems work)
[C++,python,] (general purpose, structured, no systems work)

or the like...  Don't try to tackle too compilers at once -- you'll go
mad.  Learn one well, THEN tackle number two..., and you can leverage
what you learn from the one in the other(s).

    rgb

>
> --
> Jeremy Baker
> SBN 634
> 337 College Hill
> Johnson, VT
> 05656
>

-- 
Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb at phy.duke.edu





More information about the Beowulf mailing list