self hosting on the Pi3

IOW one that will never go away. Especially since most Android apps are written in it as well as an amazing amount of turgid enterprise code that displays design patterns proudly on the sleeve of every variable name.

--
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
Loading thread data ...

Yep I recall wondering at the time why they set up 400K drives so badly. I did encounter a claim that it was for reliability.

--
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

All right time to share an ancient hack (that I actually used once).

You have a single linked list which you wish was a double linked list but due to resource limits you can't simply create a double linked list and copy the data you have to convert it in place without using any extra space. How ? (You may assume the list uses integers as pointers). . thinking space . . . . . . . . . . . . . . . . Instead of 'next' the pointer field contains 'next xor previous' provided you know where you came from 'last' you go to 'last xor pointer' to continue in the same direction.

--
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

Very nice!

I hope it was well commented, though, for the benefit of whoever would modify the code next (this included yourself!)

.....

The worst piece of tricksy, undocumented and uncommented code I remember seeing was 60 lines (one lineprinter page) of 1900 assembler. It used no variables or labels: all data was held in the 8 accumulators and all control transfers were relative jumps. The only comment in the entire mess was:

Calculate last day in month. Works until Feb 2100.

It was part of an accounting package and used this so statements could be have the last day of the current month printed on them.

This piece of code was an unnecessary piece of pure bullshit and bravado because the 1900 held dates as days since 31/12/1899 and had standard subroutines for converting a "dd/mm/yy" string to the binary form and back again, so all its author really had to do was

- set dd to O1

- add 1 to MM.

- if mm == 13, set mm to 01 and add 1 to YY We now have the first day of the next month

- call GDATEBIN to get a binary date

- subtract 1

- call GBINDATE to get the last day of the month as dd/mm/yy

This worked for any date including leap years in the range 1/1/1900 to around 31/12/22966, so no need to guess how I calculated the statement date in our then new replacement accounting system.

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

True enough - I was thinking of new systems being written and anybody much under retirement age knowing how to write code in it.

However it did have one neat trick: its output formatting was ahead of almost any other language and still is. Think how much code you'd need in any other language to get the same print formatting as the single COBOL declaration:

05 INVOICE-TOTAL PIC "Z(4)9.99CR" BLANK WHEN ZERO.

For those who don't know the COBOL: zero would produce a blank, 0.5 becomes, " 0.50 ", -0.5 becomes " 0.50CR" and, of course 1024 becomes " 1024.00 ".

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

IBM *did* screw up: Already the first documentation on the 8086 family stated clearly that the first 32 (0x0 - 0x1f) exceptions are reserved for hardware use. IBM succeeded in putting all BIOS calls in there, making already the 80186/80188 unsuitable for use with compatible software.

--

-TV
Reply to
Tauno Voipio

That was used in Data General's disk systems for sequential file block linkage.

--

-TV
Reply to
Tauno Voipio

On a sunny day (Mon, 9 Mar 2020 10:02:00 +0000) it happened Ahem A Rivet's Shot wrote in :

Yes that should work :-) Never seen that used!

If you jump into the list at some point say using hashing, then you have a problem though.

Reply to
Jan Panteltje

On Mon, 09 Mar 2020 07:23:01 GMT, Jan Panteltje declaimed the following:

4 levels represents TWO bits: 00, 01, 10, 11
--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

Algol68R was the first programming language of any type that I used at all, ever. I was introduced to it via the cafeteria service (short jobs submitted on punched cards, collect your own output from the printer -- hence cafeteria) on the university's 1906A when I was an undergraduate.

I also used Algol68RS on the 2980 that was installed while I was a postgraduate. I believe they eventually got that running on the VAX 780s they had there, but I'd gone off to try to make an honest living, by then.

Amazing to think that Algol68 is (approximately) 50 years old! The original report having been published in December 1968 and the RRE compiler having been announced in 1971. It was never all that widely adopted ... but influenced SO much that followed.

This might interest you:

formatting link

(Disclaimer: I wrote it, and any errors are mine ... etc., etc.)

--
Cheers, 
 Daniel.
Reply to
Daniel James

On a sunny day (Mon, 09 Mar 2020 12:27:29 -0400) it happened Dennis Lee Bieber wrote in :

You are absolutely right! Was probably not awake yet :-)

Reply to
Jan Panteltje

Very much mixed feelings - wherever possible use two pointers, when you can't it's a lifesaver. Now x & -x OTOH - that's just neat (two's complement machines only).

Oh yes GPFO comment with lots of detail.

Sounds a lot like the source of the BASIC for the Camputer's Lynx which I was unfortunate enough to see. Sixteen kilobytes of almost completely uncommented Z80 assembler - the only comments were clearly reminders for overnight breaks and hopelessly cryptic. It had apparently been written in six weeks - it looked like it!

--
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

Exactly this. We're doomed to suffer it for eternity. Just like COBOL.

Reply to
mm0fmf

My first exposure to the language was when I read Lindsey & van der Meulen's "Informal introduction to Algol 68".

formatting link

Have you read it? Its very good and, written with a very wry sense of humour, its about the only book about a programming language that's made me laugh.

I didn't realise it had been ported to the 2900.

Yes, and for my money it is still one of the best compilation and runtime systems I've used. The nearest rival to its crash analysis system I've seen was in the VME/B COBOL runtime - and both are streets ahead of anything the Java JVM or GNU C can offer in that area.

Good stuff - I enjoyed reading it.

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

Anyway, back to your question Bob.

You can but it will be slow and you may hit various speed bumps and bottlenecks on the way.

A possible plan would be to do this in two stages. Self-host on an x86/AMD64 PC which is well described in many places such as Linux from Scratch (LFS). That teaches you how to build a whole system from source. You can build it and run it then you know you are running your own "clean" system.

Cross Linux from Scratch also exists (I only learned this today). It's the same as LFS but uses cross compilation so you can build for ARM on your fast PC and then run the code on the Pi. Use your LFS system to build a CLFS system for the Pi. Job done, smile and drink beer.

Unless you have a desperate urge to actually do the building on a Pi then Cross LFS may be the best solution. For me, I've spent a lifetime waiting for computers to do jobs, I want things faster. I have fewer minutes left on Earth that I have already spent, so waiting for a slow (in relative terms) Pi to compile a few GB of source doesn't appeal.

YMMV

Reply to
mm0fmf

My motive is purely philosophical. I like the idea of open source systems where, at least in principle, one needn't wonder what the computer is up to. I also don't want to keep more hardware on hand than is routinely used, for sake of minimizing mental and electrical energy consumption.

Thanks for reading,

bob prohaska

Reply to
bob prohaska

I was thinking that the computer does the job and not you - so why waiting. Drink coffee or beer or whatever - the computer will finish its job. You could even make it text you when done :) I guess you are impatient that is a problem. Since children came up in my life, it doesn't matter how long something compiles. You don't have time to wait anyway, cause there are more important things to do.

Have family and children and enjoy life!

Reply to
Deloptes

On a sunny day (Tue, 10 Mar 2020 09:39:13 +0100) it happened Deloptes wrote in :

True, in the long ago past when video encoding was less than real time I would just have it run at night (encode a movie to whatever and add effects, subtitles etc).

But to compile something that may halt anytime with some cryptic error message like missing libraries etc ... you'd better watch the screen. LOL

Reply to
.

PS, I just created a solution to all this:

make 2>/dev/stdout | grep -i error | festival --tts

I have 'festival' speech synthesizer installed on my Pi4.

the keyword here is 'error'

If the compiler stderr report contains any 'error' it will talk to you. Set the volume high so you can hear it above the kids screaming. Just tested this, 'tworks!

one liner really

The above script deliberately does not respond to compiler 'warnings',' but you can obviously modify it in many ways. So now you can go on with what you were doing even with monitor off.

Reply to
Jan Panteltje

Oh boy I'll bet it has fun pronouncing filenames. I like it!

-- 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. |

formatting link

Reply to
Ahem A Rivet's Shot

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.