Everything is Typewriters

1874's Sholes and Glidden typewriter was the first commercially successful typewriter.

How the typewriter evolved into the modern programming terminal, and what comes next.

The Hughes teleprinter printed a tape of characters.

Three technologies in the 19th century revolutionized the creation and transmission of text. Telegraphs transmitted information instantly over long distances. Teleprinters automatically translated signals into text, without the need of a morse code operator. Typewriters with QWERTY keyboards made typing text something that could be done quickly and easily.

In the early 20th century, these three were combined into the teletypewriter. Type text on the QWERTY keyboard, and it instantly appears at the other end of the wire.

Teletype Model 15, 1930

The teletypewriter was used by railroad companies and Wall Street stock traders. But it requires laying wires between any two locations that want to communicate. What if you are on a boat? Radioteletype replaces the electrical wire with radio waves. During World War 2, all sides made heavy use of radio teletype to deliver messages between ships.

Enigma machine. Used by Nazi Germany to encrypt radio communications.

Radioteletype has a flaw. Anyone with another teletype machine can intercept your radio waves and listen to your communications. The Nazis solved this with the Enigma machine. They gave their officers machines which could encrypt the messages before sending them over the radio, and then decrypt them on the other end. Anyone else listening would just recieve gibberish.

Collosus. The first programmable computer. 1943

The Polish and the British were listening, and they wanted to decode the gibberish. They invented the first computers to decrypt the messages. The allies won the war and the world entered the computer age.

The Model 33 was the first teletype to use ASCII

The knobs and switches of these first computers were difficult to operate, so later computers were hooked up to teletypewriters. If you were a young Bill Gates, you used the school's Teletype Model 33 to connect a General Electric Mainframe.

ASCII Table

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33!
34"
35#
36$
37%
38&
39'
40(
41)
42*
43+
44,
45-
46.
47/
480
491
502
513
524
535
546
557
568
579
58:
59;
60<
61=
62>
63?
64@
65A
66B
67C
68D
69E
70F
71G
72H
73I
74J
75K
76L
77M
78N
79O
80P
81Q
82R
83S
84T
85U
86V
87W
88X
89Y
90Z
91[
92\
93]
94^
95_
96`
97a
98b
99c
100d
101e
102f
103g
104h
105i
106j
107k
108l
109m
110n
111o
112p
113q
114r
115s
116t
117u
118v
119w
120x
121y
122z
123{
124|
125}
126~
127

In order for a teletype terminal to connect to a computer, both must use the same digital encoding. The Teletype Model 33 was the first to use ASCII. ASCII defines a number for each character that can be typed on a typewriter. 65 is A. 66 is B. Etc. It also defines codes for other things that a typewriter can do, like move the cursor horizontally, roll the paper up a line, or go to the next page. It even has codes for when a teletype has disconnected and a code to ring a bell. Any terminal that used the ASCII protocol can connect to any computer that also uses the protocol.

Computers connected to multiple teletypes used a piece of software called an operating system to manage them. The most influential operating system, Unix, was created for the PDP-11. As computers were augmented with external devices like disks, printers, and network connections, all of these could be modeled by Unix as teletypewriters. Simply send these devices digital messages, usually ASCII, and wait for them to respond in kind. Even this website, which is served via HTTPS, uses ASCII as its base. After each header, the server sends the number 13 and then the number 10. This corresponds to carriage return and line feed, which are instructions for a typewriter to move to the next line.

DEC VT100, 1978

A great feature of a teletype terminal is that after typing in your command and getting the output, you can take the paper from the device back to your desk. This lets someone else use the terminal. But as terminals got cheaper and more useful, it became more common for each person to have their own terminal. This is when the video terminal came on the scene. It connected over the same ASCII protocol as the paper teletypes, but it was much faster and quieter.

Steve Wozniak designed a computer, the Apple I, which was cheap enough for home use. It was able to use a home television as a video terminal.

Graphics

Steve Jobs and the Macintosh, 1984

Computers had gotten cheap and useful, but still were very difficult to learn how to use. In 1984, the Macintosh brought graphical user interfaces into the mainstream. A software layer between the program logic and the video screen managed the graphics. No longer limited to sending and recieving text, graphical computers could present digital buttons that the user could click on. Windows 1.0 followed the next year in 1985.

Microsoft Word, 2003

At this point computers were a mainstay in pretty much every industry. Over the next 25 years, software steadily transitioned from typewriter-based terminal interfaces to graphical interfaces. Except for one industry. Programmers created terminal emulators, software that runs on a graphical system and behaves like a teletypewriter, and have continued to use terminal interfaces to this day.

Terminal emulator, 2024

This always confused me. Why did programmers stick with terminal interfaces when the rest of the world abandoned them as legacy software? One explanation is that programmers had to work with lots of older software and systems, so it was helpful to work in an environment that matched them. But that's hard to believe, given that graphical interfaces are over 40 years old.

Another explanation I've been given is that while terminal interfaces are harder to learn, they are fundamentally better. Programmers willing to put in the work to master the ancient art of the terminal reap benefits many times over in their improved productivity. Why don't other industries use the terminal? Well maybe they just aren't as smart as these enlightened programmers...

And its not like terminals haven't improved since the 70s. There's been many innovations that have pushed terminals into the modern age! One such innovation is colored text.... and that's it. Ok maybe not much has changed.

Putting aside their history and analyzing terminals as user interfaces, it became clear to me why programmers love them. Terminals enforce two rules which are especially useful to programmers.

  1. Every command and result is logged. Scroll up to look back at what happened.
  2. Every command can be automated as part of a program.

Despite it's usefulness, the progrmming terminal has been neglected. Since I started programming, some people have been telling me that the terminal will be obsolete in 5 years and not worth investing in. And others treat the terminal as a sacred relic that cannot be changed at all without losing all of its ancient and mysterious powers.

But the terminal is a list of automatable commands and their outputs. And I made a better one.

Snail

I was doing board game AI research, and writing lots of tools. Before writing a tool, I had to decide if it was going to be graphical or terminal based. The chess board debugger? That's graphical. The AI comparison tool? That's in the terminal. There was tension as I wanted to combine tools in the terminal but also augment them with richer UIs.

Traditional terminal emulators are completely unaware of the program running within them. The operating system runs a shell program, which sends ASCII to a terminal emulator which displays it to the user.

Snail integrates all of these pieces into one and allows them to communicate with each other more richly than ASCII text. This means you get basic features, like selecting text with the mouse as you are typing a command in Snail and seeing modern IDE-style autocomplete.

It also allows Snail to run rich graphical applications directly within the terminal.

Snail is available today for Mac and Linux. Windows support is in the works. It is free and open source, so please give a star on GitHub.