self hosting on the Pi3

Yes I have. Good book.

IKWYM, but I've read a few that have raised a smile.

The compiler was from RSRE (RRE had become the Royal *Signals* and Radar Establishment since Algol68R, hence 68RS) but I think ICL had a hand in the port. Oxford University Computing Service may have been involved in that, as well, and certainly were in the VAX port.

Yes, the diagnostics were brilliant.

Algol68RS implemented a modular compilation system. You could write a module that was DECS instead of PROGRAM. The DECS module ended with a KEEP statement, and the compiled module could be USEd in another module/program (all fairly obvious stuff). The compiler worked out when a module that was a dependency of your program needed to be recompiled and handled the build automatically. Seems pretty basic stuff today, but was amazing at the time.

I can't remember the exact syntax, but you'd write something like:

PROGRAM my prog USES foo, blah;

and foo and blah were compiled (if necessary) linked in automatically.

Thanks.

--
Cheers, 
 Daniel.
Reply to
Daniel James
Loading thread data ...

I vaguely remember reading something, somewhere, about one possible problem here ... which is that compiling a Linux system may require more RAM than the smaller Pis have available. It may be OK in a 1GB Pi3/4 and I wouldn't expect any problems in the 2GB or 4GB Pi 4 versions. At one time the biggest Pi was 512kB, and that may not be enough.

I used to build Gentoo Linux on a 1GB 1GHz VIA C3 (roughly Pentium 3 level) box, and it took about three days (with a UDMA-133 PATA hard drive for storage) ...

--
Cheers, 
 Daniel.
Reply to
Daniel James

On a sunny day (Tue, 10 Mar 2020 11:44:28 +0000) it happened Ahem A Rivet's Shot wrote in :

Thanks As to the voices, there are other text to speech solutions for the Pi, this site I found very nice:

formatting link

espeak works here, but I do not like the voice very much.

So I gave the google script there a try. I must say google wins as far as voices is concerned.

I saved (their) this script as 'gst2'

#!/bin/bash # tested en nl fr de say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "

formatting link
$*&tl=en"; } say $*

it expects something like ./gst2 "this is my text"

As we want to use a stream from stdin I wrote a second script that 'serializes it', named gst4:

#!/bin/bash read user_reply ./gst2 "$user_reply"

So gst4 calls gst2

So now echo "the quick brown fox jumps over the lazy dog" | ./gst4 gives a very nice English female voice.

I tried German, French and Dutch too, just change the tl=en to tl=de tl=fr or tl=nl in the first script. Works on my laptop and on the Pi4!

Minus point is that you need a net connection for google translate, and it takes quite a bit of bytes, so if you have a limited data-budget that maybe a problem. Was just some experimenting I did last night. make 2>/dev/stdout | grep -i error | ./gst4

Could not get 'pico' from that website to work.

I had, on an other old PC, festival working with several languages, did try to compile some on Pi4, but so far no luck running these (have not tried very hard). google translate really impresses me.

Reply to
Jan Panteltje

I've never used COBOL, but I do appreciate what's happening here.

The data division in COBOL is one of the very few forward-looking features of that language -- a declarative description of the variables used in the program. The clever bit, from the point of view of your example, is that this declaration included the external representation of the variable. Not always what you want but, for the sort of thing that COBOL got used for, occasionally very useful.

A bit of a trick question, then, really -- in any other language you'd have to specify the format each time you wanted to print that variable, whereas in COBOL you just say print( INVOICE-TOTAL ) (or however you spell that in COBOL. I can't think of ANY programming language that does this as easily as COBOL (no, not even Algol68) -- and I've puzzling over that for a few days -- though it's easy enough in spreadsheets.

I've just looked up how the CR thing worked ... so CR and DB (meaning credit or debit) both apply to negative numbers, and you define which to use depending on which side of a balance sheet you're working ... that's the sort of warped thinking that gets accountants a bad name!

I knew a little about the data division because I spent some time as Prolog hacker, in my youth, and the declarative nature of Prolog always used to confuse people *except* those who'd used COBOL and managed to draw a parallel with the data division.

--
Cheers, 
 Daniel.
Reply to
Daniel James

For printed totals and similar, that would be embedded in a print line definition, so you populate the line with MOVE statements and then WRITE ...AFTER to output it.

Worse, every data item thats read in, used and then written out to a different destination gets defined three times: once in the input record, secondly in WORKING STORAGE, and thirdly in the output record(s) it should appear in. and there tends to be at least one MOVE statement for each of these appearances. This is why COBOL programs that do anything significant are big.

The first COBOL implementations tended to require programs to be monolithic. ICL 1900 compilers would not accept programs with more than

12000 lines. Fortunately anything much over 5-6000 lines was rare, but with all the other verbiage you seldom saw an externally defined subroutine of under 300 lines or a free-standing program of under 1000.

You got it, and don't forget the option of inserting commas at the thousand, million and billion points. Fortunately, in this day an age, using, say, Java it would be easy to define a set of static numeric formatting methods for financial values and wrap them in a Class declaration for convenience. Once you get to financial input andf display, you really want to let the users abbreviate as much as possible, so you might want to accept something like any of $1.5B , USD1.5B, 1500M USD or 1,500,000,000.00 USD as all meaning one and a half billion US dollars while holding the value internally as binary cents in a signed 64 bit integer or a BigInteger.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

On Thu, 12 Mar 2020 13:58:14 -0000, Daniel James declaimed the following:

Take into account that, for much of COBOL (especially the early stuff), numeric data was stored as BCD. Later editions offered options for machine floating point and native integers (usage is comp). So... the PIC description wasn't just defining the print-format, it also defined the internal storage format (other than the nature of the sign representation

-- the sign indicator itself may have been special code in the place-holder for the decimal point in the BCD...)

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

That depended on whose hardware and compilers you were using.

IIRC smaller IBM kit (s/360 models 20 and 30, System/3 and System/38 used BCD because that was the only type of arithmetic they had. I did my time on AS/400 (RPG3 - yeech! and a bit of PL/1) but don't remember what arithmetic it used, but probably both BCD and binary. I've never used IBM big iron.

However, I wrote a lot of COBOL on ICL 1900 kit between 1969 and 1977. These were 24 bit word-based and didn't do BCD at all. Even the lowly

1901 used 24 bit words, but took two bites at many operations because it only had a 12bit mill. I have a feeling that the 2900s could do BCD but programs were more likely to use 32 bit binary because that was faster, but it was hard to know exactly because 2966 was a very soft box indeed. So were the 2900 disk controllers - a lot of them were built into desks and called ICL 2903 office computers. These ran unmodified 1900 code and all the usual 1900 compilers etc - I wrote PLAN assembler on them too.

Later, I wrote a bit of COBOL on DEC VAX/VMS kit too, and IIRC that was also word oriented.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

I posted too soon ... Ada (of course!) has library support that mimics COBOL input and output formatting in the Text_IO.Editing package.

The Ada package is modelled on COBOL, but doesn't implement everything you can do in COBOL (no internationalization, radix indication, or parentheses to indicate negatives) but the using CR or DB to indicate a negative is there ...

--
Cheers, 
 Daniel.
Reply to
Daniel James

Interesting. I've never used Ada.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

I should have added that the main problem with COBOL is that its far too damn verbose, e.g.

READ CUSTOMER-FILE INTO CUST-REC KEY CUST-NAME INVALID PERFORM UNKNOWN-CUST-NAME.

and back in the day, when programs were punched on cards and compilation listings came out on the lineprinter, Murphy said that the printer would be slightly out of register and its ribbon was old and dry, which made the full stop at the end of each sentence almost invisible. Full-stops mean stuff to a COBOL compiler!

But I thought then, and still think now that its fundamental flaw is that its designers thought that there are two types of programmer: those who understood Fortran/Algol/C style assignments and others who could only understand something that looked like English text, but who could nonetheless understand all the ramifications of a complex data declaration or some of the more arcane variations of a PERFORM or a SORT statement. Thats' false thinking, of course, but it did leave us with the most verbose computer language in the known universe.

Right: back to writing Java.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

The largest output per bad byte of source I've ever seen came from a COBOL compiler absorbing the consequences of a missing full stop (IIRC after the word DIVISION). It got very confused and went on about it at great length.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
The computer obeys and wins.                |    licences available see 
You lose and Bill collects.                 |    http://www.sohara.org/
Reply to
Ahem A Rivet's Shot

Looks like it's time to repost

THE COMMON BUSINESS-ORIENTED GOLDILOCKS

(which originally appeared in an ancient issue of Datamation):

000001 IDENTIFICATION DIVISION. 000002 PROGRAM-ID. ACOBOLFABLE. 000003 DATE-WRITTEN. ONCE UPON A TIME. 000004* THIS IS AN EXAMPLE OF COBOLX VERSATILITY. 000005 000006 000007 000008 ENVIRONMENT DIVISION. 000009 CONFIGURATION SECTION. 000010 OBJECT-COMPUTER. ANY MUSIC-BOX, MEMORY SIZE 8**64 CHARACTERS 000011 19 TAPE-DRIVES, 11 DISC-DRIVES, 000012 1 GOLDILOCKS, 3 BEARS. 000013 INPUT-OUTPUT SECTION. 000014 FILE-CONTROL. 000015 SELECT TAPE-DRIVES, ASSIGN TO CREDITOR. 000016 SELECT DISC-DRIVES. 000017 SELECT GOLDILOCKS, SELECT BEARS; ASSIGN TO ONE-COTTAGE. 000018 I-O-CONTROL. 000019 APPLY RED-TAPE ON TAPE-DRIVES 000020 APPLY HOFFNUNG-RECORD ON DISC-DRIVE 000021 APPLY GOLDI, BEARS ON COTTAGE. 000022 000023 000024 000025 DATA DIVISION. 000026 FILE SECTION. 000027 FD GOLDI 000028 LABEL RECORDS ARE STANDARD 000029 VALUE OF FILE-ID IS 'GOLDILOCKS' 000030 DATA RECORD IS GOLDILOCKS. 000031 01 GOLDILOCKS. 000032 02 HGT SIZE IS 62 INS. 000033 02 WGT SIZE IS 110 LBS. 000034 02 VITAL-STATS. 000035 03 B 38. 000036 03 W 24. 000037 03 H 36. 000038 02 RATING 100%. 000039 01 FD 3-BEARS 000040 LABEL RECORDS ARE STANDARD 000041 VALUE OF FILE-ID IS 'BEARS' 000042 DATA RECORDS ARE DADDY-BEAR, MUMMY-BEAR, BABY-BEAR. 000043 01 DADDY-BEAR. 000044 02 HGT 70 INS. 000045 02 WGT 750 LBS. 000046 02 COLOR OF EYES BLOODSHOT. 000047 02 DISPOSITION UNBEARABLE. 000048 01 MUMMY-BEAR. 000049 02 HGT 65 INS. 000050 02 WGT 700 LBS. 000051 02 COLOR OR EYES BLUE. 000052 02 DISPOSITION BEARABLE. 000053 01 BABY-BEAR. 000054 02 HGT 40 INS. 000055 02 WGT 200 LBS. 000056 02 COLOR OF EYES BLUE. 000057 02 DISPOSITION INFANTILE. 000058 000059 WORKING-STORAGE SECTION. 000060 01 COTTAGE PICTURE IS COZY. 000061 02 KITCHEN. 000062 03 TABLE SIZE IS LARGE, VALUE IS 1. 000063 03 CHAIRS SIZE IS MEDIUM, VALUE IS 3. 000064 02 PORRIDGE. 000065 03 KING-SIZE OCCURS 1 TIMES. 000066 03 QUEEN-SIZE OCCURS 1 TIMES. 000067 03 PRINCE-SIZE OCCURS 1 TIMES. 000068 02 DOOR SIZE IS USUAL, VALUE IS OPEN. 000069 02 BEDROOM. 000070 03 BED. 000071 04 LARGE OCCURS 1 TIMES. 000072 04 MEDIUM OCCURS 1 TIMES. 000073 04 SMALL OCCURS 1 TIMES. 000074 03 WINDOW SIZE IS SMALL, VALUE IS OPEN. 000075 01 RIGHT-COTTAGE REDEFINES COTTAGE, VALUE IS SAME. 000076 01 KING-SIZE-BED-SLEPT-IN SIZE IS BIG, VALUE IS ROCK-BOTTOM. 000077 01 QUEEN-SIZE-BED-SLEPT-IN SIZE IS MEDIUM, VALUE IS DEPRESSED. 000078 01 NO-PORRIDGE SIZE IS SMALL, VALUE IS ZERO. 000079 01 SIP SIZE IS LITTLE, VALUE IS 'SSSLUP'. 000080 01 SLUMBERLAND SIZE IS UNLIMITED, VALUE IS ZZZZZZZZZZ. 000081 CONSTANT SECTION. 000082 01 COMMENT1 PIC X(36) 000083 VALUE 'SOMEBODY HAS BEEN EATING MY PORRIDGE'. 000084 01 COMMENT2 PIC X(36) 000085 VALUE 'SOMEBODY HAS BEEN SLEEPING IN MY BED'. 000086 000087 000088 000089 PROCEDURE DIVISION. 000090 FOREST SECTION. 000091 START-OF-TALE. 000092 OPEN STORY. READ FOLLOWING. 000093 FIRST-MOVE. 000094 MOVE GOLDILOCKS TO COTTAGE. 000095 IF DOOR IS CLOSED OR BEARS ARE GREATER THAN ZERO 000096 ALTER ENTER-GOLDILOCKS TO PROCEED TO HASTY-RETREAT. 000097 ENTER-GOLDILOCKS. 000098 GO TO KITCHEN-SCENE. 000099 KITCHEN-SCENE. 000100 IF PORRIDGE = KING-SIZE 000101 PERFORM TASTE-ROUTINE 000102 VARYING PORRIDGE FROM KING-SIZE BY 1 000103 UNTIL PORRIDGE = PRINCE-SIZE 000104 ELSE 000105 COMPUTE IF COTTAGE = RIGHT-COTTAGE. 000106 GO TO BEDROOM-SCENE. 000107 TASTE-ROUTINE. 000108 SUBTRACT SIP FROM PORRIDGE (KING-SIZE). 000109 SUBTRACT SIP FROM PORRIDGE (QUEEN-SIZE). 000110 SUBTRACT SIP FROM PORRIDGE (PRINCE-SIZE) GIVING NO-PORRIDGE. 000111 BEDROOM-SCENE. 000112 MOVE GOLDILOCKS TO BEDROOM. 000113 ADD GOLDILOCKS TO BED (LARGE). 000114 DISPLAY 'IT IS TOO HARD'. 000115 SUBTRACT GOLDILOCKS FROM BED (LARGE) 000116 GIVING KING-SIZE-BED-SLEPT-IN. 000117 MOVE GOLDILOCKS TO BED (MEDIUM). 000118 DISPLAY 'IT IS TOO SOFT'. 000119 SUBTRACT GOLDILOCKS FROM BED (MEDIUM) 000120 GIVING QUEEN-SIZE-BED-SLEPT-IN. 000121 MOVE GOLDILOCKS TO BED (SMALL). 000122 DISPLAY 'IT IS JUST RIGHT'. 000123 ADD GOLDILOCKS TO SLUMBERLAND. 000124 BEARS-RETURN. 000125 MOVE DADDY-BEAR, MUMMY-BEAR, BABY-BEAR TO KITCHEN. 000126 MOVE CORRESPONDING BEARS TO PORRIDGE. 000127 DISPLAY 'DADDY BEAR', COMMENT1. 000128 DISPLAY 'MUMMY BEAR', COMMENT1. 000129 DISPLAY 'BABY BEAR', COMMENT1, 'AND EATEN IT ALL UP'. 000130 MOVE BEARS TO BEDROOM. 000131 BEARS-IN-BEDROOM. 000132 INSPECT BEDS REPLACING ALL GOLDILOCKS BY BEARS. 000133 DISPLAY 'DADDY BEAR', COMMENT2. 000134 DISPLAY 'MUMMY BEAR', COMMENT2. 000135 DISPLAY 'BABY BEAR', COMMENT2, 'AND HERE SHE IS'. 000136 HASTY-RETREAT. 000137 IF WINDOW IS OPEN 000138 EXIT GOLDILOCKS 000139 ELSE 000140 MOVE GOLDILOCKS TO DOOR. 000141 EXIT. 000142 END. 000143 CLOSE STORY. 000144 DISPLAY 'WOULD YOU BELIEVE CINDERELLA IN PL/I'. 000145 END TALE. 000146* "THE COMMON BUSINESS-ORIENTED GOLDILOCKS" BY PHILIP STANLEY 000147* (CONVERTED TO ANSI74 BY CHARLIE GIBBS)

C for me, thanks.

--
/~\  Charlie Gibbs                  |  Microsoft is a dictatorship. 
\ /        |  Apple is a cult. 
 X   I'm really at ac.dekanfrus     |  Linux is anarchy. 
/ \  if you read it the right way.  |  Pick your poison.
Reply to
Charlie Gibbs

Excellent! - and I hadn't seen it before.

Yeah, C is cool, and the GNU C compiler keeps getting better, but I do like the huge Java graphics library, particularly if you add in the wonderful RiverLayout 3rd party layout manager from

http://zoogz/java/envj/se/datadosen

It makes laying out a window about as easy as it used to be with a decent

4GL like, say, Sculptor.
--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Its designer. Grace Hopper, a US Navy rear admiral.

No,that is assembler Grace wrote Cobol for accountants who understood their data, not computers.

It was also written so that it could run on small RAM computers A considerable achievement. I regard it with teh same awe as 'C' in that it allowed massive programs to be written by quite ordinary programmers

--
Gun Control: The law that ensures that only criminals have guns.
Reply to
The Natural Philosopher

Well, actually she wrote the first assembler, FLOW-MATIC the grandfather of COBOL and masterminded MATH-MATIC which heavily influenced FORTRAN.

Look up FLOW-MATIC in wipedia - there's a big enough example to give a decent idea of the language. It was a rather less verbose language than COBOL and you could also claim it was an origin of BASIC, since it used line numbers instead of labels.

But I still think COBOL was a wrong part, it only because there was never a consistent grammar which made compilers much bigger and slower because most of its verbs needed their own parser - the only consistency is that all its sentences are imperative and start with the verb. Parsing compound statements must be a nightmare, and don't get me started on the ALTER verb!

Of course, since *everything* had very little RAM in those days. Remember program overlays and multi-pass compilers with lots of workfiles? And not forgetting the COBOL ALTER verb, a crutch for flea-power computers if there ever was one.

The first machine I used had a whole 8K of 39bit words, no storage other than paper tape, but compiled Algol 60 considerably faster than I ever got a 1903S (32K 24 bit words and 50MB disks) to it.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

On Fri, 13 Mar 2020 16:41:25 +0000, Ahem A Rivet's Shot declaimed the following:

In my college days, we had a student who'd fed her object file back into the compiler... That generated a wad of error output...

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

[quote] You can generate a complete listing of compiler diagnostic messages with their message numbers, severities, and text by compiling a program that has program-name ERRMSG.

You can code just the PROGRAM-ID paragraph, as shown below, and omit the rest of the program.

Identification Division. Program-ID. ErrMsg. [/quote/

formatting link

--
Lew Pitcher 
"In Skills, We Trust"
Reply to
Lew Pitcher

My only professional run-in with COBOL was an interval of maintaining and enhancing a poor man?s version of runoff (needed for a documentation project) written in COBOL.

That?s when I found that a period omitted in the middle of an IF nest didn?t produce a syntax error, but it radically altered the operation of the program!

Given the ?now you see them, now you don?t? behavior of line printer periods and their general resemblance to flyspecks, I decided that COBOL was not for me...

--
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com
Reply to
Michael J. Mahon

Just about any language can be compiled on a small computer as long as:

1) you have a couple of tapes, 2) you are willing to sort the source program multiple times, and 3) time is not an object.

In fact, this was the common compiler approach!

--
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com
Reply to
Michael J. Mahon

There was a period of several years when many compilers had pragmas to print all their error messages. I always suspected it was done to allow easy verification that there were no inappropriate messages (i.e., obscene or insulting). ;-)

--
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com
Reply to
Michael J. Mahon

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.