News for hackers. Stuff that matters.
Re:Unix History and the `DC` Calculator by throwaway81523 on Tuesday September 03, 2024 @02:31AM (#41431907)
"This is a very simple algorithm, and it needs only very simple tools. Perhaps this is why dc, the UNIX RPN calculator, was the first utility ported to UNIX, way back in the PDP-11 days. It even predates the C programming language; originally it was implemented in B"

I'm pretty sure the version with v6 Unix was written in PDP-11 assembler. It's possible it was translated from a version written in B? It wasn't THAT simple, since it had to implement arbitrary precision arithmetic. I have a vague memory of it using a "buddy system" storage allocator, a scheme also described in Knuth volume 1. Maybe the code is still around somewhere.

Re:Unix History and the `DC` Calculator by throwaway81523 on Thursday September 05, 2024 @03:45AM (#41454490)
Self-followup: yes, the v6 source code is here: dc1.s, dc2.s, etc.

https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/...