awk is remarkably fast
Remember a few days ago I'd been fiddling around with various languages to generate 1D cellular automata? The timing I got for this was surprising:
1 hr 8 minutes -- the old CoCo computer
5 minutes -- the CoCo emulator running as fast as my computer allowed
12 minutes -- using python
And now....
0.08 second -- awk creating an image file
Not bad for an ancient (46 years old) language!
I didn't use awk to display directly to the screen because awk doesn't have graphics commands, nor does it have any usable extensions that would let it do graphics. So to get around that problem I told it to write a .pbm image file that I could display.

Maybe the screen display routines are what slowed python and the CoCo emulator down so much. I'll rewrite the python program to build a .pbm image and see how that compares.
The PBM format, and its sisters, PGM, and PPM were developed as a way to make it easy to reliably transmit images over the early internet. Each pixel is represented by a number in ordinary text -- only 0 (white) and 1 (black) for PBM files. Gray values can be represented by PGM files, again using text decimal numbers for each pixel. Color up to 24 bits per pixel can be recorded in PPM files, with each pixel being a triplet of decimal numbers written as text.
The three formats also have binary formats that are faster to read and write and are more compact, but don't have the attractiveness of being so easily written by a program that manipulates text.
---
More surprises. I rewrote the python program to do the same thing as my awk program. It writes to a pbm image file instead of to the screen. My unoptimised awk program took less time than my new python program, which was also unoptimised.
0.123 seconds - awk
0.139 seconds - python writing to a file
12 minutes 39 seconds - python writing to the screen
So my earlier python program was spending almost all its time in the graphics routines.
I wonder if it's possible to find a simpler, faster way to write to a screen. One of the things old computers did really well was writing directly to the screen. Unfortunately, extra capabilities of modern computers require extra calculations that slow everything down -- being able to write to an arbitrarily sized and positioned window, for example. If you have extra layers of a language to interpret graphical commands this further slows everything.
1 hr 8 minutes -- the old CoCo computer
5 minutes -- the CoCo emulator running as fast as my computer allowed
12 minutes -- using python
And now....
0.08 second -- awk creating an image file
Not bad for an ancient (46 years old) language!
I didn't use awk to display directly to the screen because awk doesn't have graphics commands, nor does it have any usable extensions that would let it do graphics. So to get around that problem I told it to write a .pbm image file that I could display.

Maybe the screen display routines are what slowed python and the CoCo emulator down so much. I'll rewrite the python program to build a .pbm image and see how that compares.
The PBM format, and its sisters, PGM, and PPM were developed as a way to make it easy to reliably transmit images over the early internet. Each pixel is represented by a number in ordinary text -- only 0 (white) and 1 (black) for PBM files. Gray values can be represented by PGM files, again using text decimal numbers for each pixel. Color up to 24 bits per pixel can be recorded in PPM files, with each pixel being a triplet of decimal numbers written as text.
The three formats also have binary formats that are faster to read and write and are more compact, but don't have the attractiveness of being so easily written by a program that manipulates text.
---
More surprises. I rewrote the python program to do the same thing as my awk program. It writes to a pbm image file instead of to the screen. My unoptimised awk program took less time than my new python program, which was also unoptimised.
0.123 seconds - awk
0.139 seconds - python writing to a file
12 minutes 39 seconds - python writing to the screen
So my earlier python program was spending almost all its time in the graphics routines.
I wonder if it's possible to find a simpler, faster way to write to a screen. One of the things old computers did really well was writing directly to the screen. Unfortunately, extra capabilities of modern computers require extra calculations that slow everything down -- being able to write to an arbitrarily sized and positioned window, for example. If you have extra layers of a language to interpret graphical commands this further slows everything.