Here’s a video demo and presentation, on dc
, the Unix program which predates ‘C’ and indeed constitutes a programming language:
dc
will run to arbitrary precision, limited by memory, and you’ll see from the thumbnail it supports macros and recursion. In fact that’s its only offering, but it’s enough. The paradigm is stack-based, RPN, with single-character syntax (and therefore something like 26 registers and 26 macros, I will guess.)
Not only is it very old, but it’s also current - my MacBook has a dc, which turns out to be a GNU dc. And what’s more, as bc
, the more user-friendly but in some ways less capable ‘basic calculator’, was originally built on top of dc
, it turns out dc
has probably been very widely used indeed.
Ken Thompson has said that Robert Morris wrote dc
(in assembly language, apparently) and that it was the very first program written on their PDP 11/20, at a point when the disk hadn’t yet been delivered and the machine ran their nascent Unix port from paper tape.
But note that Doug McIlroy has a slightly different take here:
On the tiny PDP-7 the assembler was supplemented by
tmg
, Doug McIlroy’s version of Bob McClure’s compiler-compiler. Using it Thompson wrote B, the evolutionary link between Martin Richards’s (Cambridge University) BCPL and C. The PDP-11 assembler, a desk calculatordc
, and B itself were written in B to bootstrap the system to the PDP-11. Because it could run before the disk had arrived,dc
- not the assembler - became the first language to run on our PDP-11. Soon revised to handle arbitrary precision numbers (v1),dc
was taken over by Bob Morris and Lorinda Cherry. It now ranks as the senior language on UNIX systems.
If you like keystroke-programmed arbitrary-precision RPN, or HP’s 48g calculator (from 1990), you might also like calc-mode within Emacs, also from 1990, as described in this nearby video:
You’ll get some of the features of the HP 28 calculator, but at arbitrary precision and unbounded stack depth. You’ll get RPN, keystroke, and algebraic modes of operation. You’ll get arrays and complex numbers.
See also Brian Kernighan interviews Ken Thompson at VCF East and Repairing HP’s 9100B desktop computer/calculator - videos