There is no doubt that the original Pascal/WEB implementation of TeX is a masterpiece and I have learnt a lot reading through the source code (both weaved and tangled) but it definitely shows its age. Most of the code deals with things like lower-level datastructures and memory management that would be vastly simpler or unnecessary in a more modern language with good libraries.
Have there been efforts to reimplement TeX in a modern language such as Python while keeping full backwards compatibility?
At various times I've endeavoured this myself and have made some progress but I'm interested if other work exists.
fast get availprocedure) so it was necessary to hard code several things; although some parts are a bit puzzling (hard coded constants like400or255; and maybecmdandchrcould be packed into a struct/Pascal record? Also not sure about all those one-char var names). On the other hand even programming in C isn't very convenient either (no automatic destructor/something like C++'s for-range for conveniently iterating over linked list. – user202729 Jul 11 '22 at 03:23