Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: Good practical language and OS agnostic text? Date: Fri, 20 Apr 2012 07:02:58 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 68 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-04-046@comp.compilers> References: <12-04-029@comp.compilers> <12-04-035@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1334978401 45843 64.57.183.58 (21 Apr 2012 03:20:01 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 21 Apr 2012 03:20:01 +0000 (UTC) Keywords: books, comment Posted-Date: 20 Apr 2012 23:20:01 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:589 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]