On 01/04/2012 04:51 PM, Fred Cisin wrote:
On Wed, 4 Jan 2012, Vintage Coder wrote:
I actually thought of trying to write a compiler
in modern FORTRAN since
I seem to be too old to learn anything new, but the F90 and later
language is so wierd and ugly (good grief, lower case and indentation?!
Sacrilege!) I decided against it.
<rant>
F90 and even Fortran77 are nice languages for some people,
BUT THEY AIN'T FORTRAN !
Never used Fortran.
My first language was Darthmuth BASIC on GE Tymeshare.
Next year (this was still thae dark ages 1969) I was exposed to be BOCES
LYRICS
PDP8I Timeshre system BASIC and FOCAL.
My pet peve with both was very minimal string handling, I want to answer
"yes|YES"
to a question not "1".
That lead to PAL, and the awkward path to assembler.
I thought I
had read one of the early IBM FORTRAN compilers was written
in FORTRAN but the G& H compilers appear to be in assembler like all
the other OS/360 stuff.
It used to be that EVERY CS grad student wrote a new
language, as a rite
of passage. I don't know whether that was required by the university, or
just social pressure.
One of the "requirements" was that the final version of it must have been
written in it and compiled BY IT. (Obviously earlier versions must have
used assemblers and/or compilers of other languages)
While it seems like a nice "proof" of the language, it very clearly shows
a lack of understanding that if the new language was not intended for, and
designed as, a compiler authoring tool, that that would certainly NOT be
the best choice for creation of the final product.
Not a CS student and never thought that made sense. Right up there with
every
machine shop student making a hammer. And not even a good one!
Of course, many schools (UC Berkeley) DON'T CARE
about that, and teach
that if the only problems are speed and size performance, that the
correct solution is throw hardware at them!
"If you want to sort an array larger than 64K, then GET MORE RAM."
"If it's too slow, then use a faster computer." (also used by OS tech
support with, "I'm amazed that it can even RUN on such obsolete [1 year
old], inadequate [Are YOU inadequate?] hardware! Try something more
current!")
Thats broke. IF you can get a bigger machine, nice. Most cases you use
what
you have as in the real world the purchasing isn't delivering before
your due date.
Note: I made my Data Structures and Algorithms
students write a MERGE
program to combine two already sorted files. I've heard UC grads insist
that the CORRECT way to write it is to append the two files, load the
result into memory, and use a Shell Metzner sort. [How many things are
wrong with THAT?]
I took data structures using PASCAL at SUNY.. The first day was discussion
on how to use 029 and feed the Univac1180, bah! I asked if I coud use my
NS* Horizon. After the, whats that?? I would bring it tto the next
class and
demonstrate UCSD PASCAL running on Z80 with floppies and how using a
video scree editor on a H19 terminal (in ansi mode). Youd have thought
I've just demonstrated Nuke Fusion.. Needless to say I never learned the
029 or the 1180 but I did learn data structures.
C is pretty good for writing compilers, and it takes
little more than "The
dragon book" (Aho& Ullman) plus a LOT of time and effort to produce one.
C is best at systems programming, particularly due to how easy it is to
shove it out of your way if you need to get closer to the hardware, but
C is often MISUSED for writing general purpose and even business programs,
for which it can be spectacularly inappropriate.
C is a basic tool, like a macroassembler. A good library can make
programming
tasks easier.
C is one of the few (PASCAL and Fortran also) that if its on a machine
generally
we are taking the same language where BASIC often can be variable from
tinybasic to all the various flavors that can run some but not always
programs
from other BASICs.
FORTRAN is well suited for many things, including a
lot of different kinds
of scientific programming, but is NOT a good choice for writing compilers.
Maybe F90 might be better, to use INSTEAD OF FORTRAN.
PASCAL is a good rigorous INTERMEDIATE (not first exposure) teaching
language. It's usable, but not great, for compiler writing. For example,
see the runtime library used in the early Microsoft compilers,
particularly their FORTRAN compiler (where simple benchmarks, such as a
"Sieve of Erastothanes" run slower than interpreted BASIC)
PASCAL to me is like C, for somethings C is too close to the iron where
PASCAL is often too far from the iron. So if the task is to talk to iron
PASCAL is wrong where C micht not be the best choice to write a database
that requires rigorous type checking.
What is SCHEME best suited for? (An answer of
"EVERYTHING" will destroy
your credibility.)
Beats me, never used it, or Ruby or Python to name a few. I've use LUA
in embedded 32bit work. Its JALWIOPS.. Just Another Language With Its
Peculiar Stuff.
Borrowed from the early days:
Wygins: What You Get Is No Surpize (early LQ printers and editors).
WYSIWYG: What You See Is What You Get (graphic screen editors with,
images and fonts.
Often missed is WGMA, What Gets the Message Across.
Does anybody write compilers in assembly any more? Or
ever will, again?
</rant>
I thought C was for that, ducking and running. ;)
Seriously C is maybe one step above a good Macroassembler and
for PDP11 maybe it is assembler.
For some machines I see C used but it fits not at all, PIC and other
small chips.
I still write code for things like Z80, PIC and 8051 relatives in ASM
because even if the rom got bigger, dang it, the tasks did too.
The old saw is still true, programs will expand to exceed the available
space
only now thats typically 8GB and it needs 4 2.8Ghz cores to plow through it.
In the end my old NS* Horizon stilll boots faster and prints that letter
saying your
payment is still overdue. OK, so it's prints to a Laserjet4L and the
letter is marked
up with Runoff but, the uVAX running current VMS can print that same letter
and so can the PC under linux. In the end getting the task done is more
than
all the fancy cruft and CPUs with a bag on the side.
Allison