From cisin at
xenosoft.com Thu Jan 5 07:08:31 2012
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 !
Well I thought I was the only one. People born in the last 20 or 30 years
laugh at me when I write FORTRAN, they tell me it's not "FORTRAN" it's
"Fortran" when I know damn well it's an acronym! And they say unindented
code in all caps is unreadable which is just the opposite of my experience
and I don't know how they can explain how we were able to read and write it
back in the day and now it's unacceptable but I realize my opinions are
usually if not always in the minority and nobody listens to me anyway, so...
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.
Agreed. I only considered it to get myself out of somewhat of a design
slump. And I wound up not doing it anyway. Still slumpin'
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!")
Fortunately in the business I am in that hasn't been much of an option or
an issue although our customers frequently consider it an option. I hope
there is no relation (they also write code) but I don't know.
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.
Emphasis on a LOT of time, I looked at the book and gave up! Blinded me,
with SCIENCE!
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.
Toby and I and others had this discussion recently. You have stated what
seems to have been our consensus.
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 as delivered was pretty unusable. I'm not a UNIX guy, not by a long
shot and none of the UNIX heros show up on my radar, but I must say
Kernighan's (I think?) elegant piece on what's wrong with PASCAL nailed the
coffin shut. Of course many later implementations solved those problems and
there are certainly usable dialects and have been for a long time.
What is SCHEME best suited for? (An answer of
"EVERYTHING" will destroy
your credibility.)
I have no idea but I'm sure you will get some answers ;-)
Does anybody write compilers in assembly any more? Or
ever will, again?
Yeah as far as I know, IBM always has and still does. I am not sure about
the XL series though.
--
+------------------------------------------------------------------------+
| Vintage Coder America Online ivagntrpbqre at nby.pbz <ROT13> |
| |
| Collecting: DOS assemblers, compilers, & books (Z80, M68K, 6502, 808X) |
| Software & doc for IBM S/360 through OS/390 |
| |
| Wants: Ada 95 compilers for MVS/ESA & Solaris SPARC |
| PL/I X Optimizing Compiler for MVS, APL/SV for MVS |
| Stony Brook Modula-2 for Solaris SPARC |
|---------------------------------------+--------------------------------|
| Powered by Slackware 64 Intel and Solaris 10 SPARC |
|=======================================+================================|
| PGP Key 4096R 0x1CB84BEFC73ACB32 Encrypted email preferred |
| PGP Fingerprint 5C1C 3AEB A7B2 E6F7 34A0 2870 1CB8 4BEF C73A CB32 |
+------------------------------------------------------------------------+