Dave Cutler (b 1942) has been continuously paid to write code for 53 years.
Chuck Moore of Forth fame was the other mention in these comments that just stayed digging deep into systems pushing the state of the art of his style of tiny, flexible, stack-oriented systems. Both of them contributed to real products, too, instead of only theory.
I originally started to write something that explicitly called out some of the other examples as cases of talented amateurs (in the best possible sense of the term, and only vis-à-vis actual coding as opposed to producing books and theorems).
But, the cases of Cutler and Moore are probably what we mean by "longest-serving".