Re: Good practical language and OS agnostic text?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Fri, 20 Apr 2012 07:02:58 +0000 (UTC)

          From comp.compilers

Related articles
[18 earlier articles]
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-19)
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-19)
Re: Good practical language and OS agnostic text? bc@freeuk.com (BartC) (2012-04-19)
Re: Good practical language and OS agnostic text? compiler.ddj@h-rd.org (2012-04-19)
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-19)
Re: Good practical language and OS agnostic text? arnold@skeeve.com (2012-04-20)
Re: Good practical language and OS agnostic text? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2012-04-20)
Re: Good practical language and OS agnostic text? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2012-04-20)
Re: Good practical language and OS agnostic text? bc@freeuk.com (BartC) (2012-04-20)
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-20)
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-20)
Re: Good practical language and OS agnostic text? compilers@is-not-my.name (2012-04-20)
Re: Good practical language and OS agnostic text? jthorn@astro.indiana.edu (Jonathan Thornburg) (2012-04-20)
[20 later articles]
| List of all articles for this month |
From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Fri, 20 Apr 2012 07:02:58 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 12-04-029 12-04-035
Keywords: books, comment
Posted-Date: 20 Apr 2012 23:20:01 EDT

compilers@is-not-my.name wrote:


(snip)
>> It is dated, (as proven by the choice of source and target languages:
>> "Rascal" [Rudimentary Pascal] and IBM 370 assembler) but still an
>> excellent guide for your first attempts at compiler writing.


(snip)
> I don't generally like the Wirth languages because they often have built in
> limitations that make them unsuitable for real work. However they do seem
> amenable to changing them so that they are useful. People took Pascal and
> Modula-2 in new directions and many variations are supposed to be pretty
> good. I'll look at Oberon again now that you mention it. Thanks for your
> post!


One Wirth language that you might find interesting is PL/360.


PL/360 looks like a high-level language but works like assembly
language. As an example (which I am remembering from 40 years ago)


      R1=R1+R1+R1;


compiles to


      LR R1,R1
      AR R1,R1
      AR R1,R1


and so multiplies R1 by four. Note that it is low level in that the
registers are represented by variables such as R1. The PL/360
compiler, and its generated code, should run just fine on z/OS. It is
available in PL/360 source, so you can modify it and play with it all
you want.


I might have some idea what you are asking about, though. Much of my
early programming work was with OS/360. First Fortran, but after not
so long PL/I. PL/I was much more fun to program in, but not so many
systems had PL/I compilers available. Also, not so much later I
started S/360 assembler programming.


I worked on many other systems over the years, PDP-10, VAX, 80286
(running MSDOS and later OS/2), Sun, HP, and more. Still, S/360 was
always my favorite.


But I don't understand your refusal to use the tools that are
available. FLEX and BISON are freely available, you can't complain
that they cost too much. You can run them on a freely available OS
(Linux, FreeBSD, Solaris, etc.) on machines that you can find for very
low prices, or often enough given away.


The nice thing about the tools is that you can get something running
fairly fast, and without needing to get too deep into the math. You
can go as deep or shallow into the innards of FLEX and BISON as you
want. One project that should be about right for one person, and
without a lot of math, is rewriting FLEX and BISON to generate code in
another language, such as PL/I.


As I mentioned before, with LCC and the LCC book, it is pretty easy to
write a new code generator without rewriting the rest of the compiler.
Writing a PL/I front end for LCC would be somewhat more work, though.


There were some working on a PL/I front-end for gcc, though I haven't
heard much about that for some time now.


-- glen


[PL/360 was a great little language, but the source code to the
compiler was apparently lost. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.