Can I access this in LaTeX in any friendly way? What I want to do is replicate the namespace features of modern dynamic languages, so I can "import" macro names into files, and then collate this collection of files somehow to produce the whole document, in a way that doesn't lead to name conflicts.
TeX starts with a collection of macros called Plain.TeX that get written out in 'binary' so that they load quickly. 'The TeXBook' essentially assumes Plain.TeX.
As I recall, for LaTeX, there were some tweaks to Plain.TeX, and I don't understand the tweaks. There is a chance from the tweaks that some of the scope of names in TeX and LaTeX are different.
But, for scope of names, essentially as in a 'namespace', or as in name scoping in, say, PL/I or Algol or OOP languages, TeX has that done nicely at least for just one macro at a time. So, if bring in a macro, then need not worry about names within the macro conflicting with names outside the macro. Among the macros I wrote are some for dynamic allocation of storage of the various types within a macro.
For more, long names are permitted so that could use those to identify a 'package' or 'namespace' of many macros that call each other.
For more, I'd have to get out 'The TeXBook' and read again! The bad news for me is, I wrote the macros a long time ago so do not remember all the details. Indeed, what I wrote for verbatim was darned tricky, and I'd need two hours just to understand the crucial points in those.
But 'The TeXBook' is plenty readable. For some questions, can write some little tracing and printing macros (I did) and use the TIFO method, try it and find out.
Broadly, though, it does appear to me that Knuth was mostly thinking about one author with mostly their own macros and was not thinking about some world wide 'distributed' document and software development with a world wide name 'registration hierarchy', etc. In particular, if I were to send you some of my work with TeX, what could I send? My TeX input file? Darn, that assumes my full macro collection, and I wouldn't want to bother you with that. So, send you a DVI file? That assumes that you have the same font collection I do, and just what that is is not always so clear. So, net, the easiest thing to send is just a PDF file that has the font definitions inside the file. Broadly, then 'group' work was not a big design priority.
I have a friend, a good mathematician, who won't touch TeX and keeps running it down. Some of his criticisms are valid. E.g., look at 'The TeXBook': Essentially just one color. On each page, usually just one column. No page to page cross references. Not much in graphics except where the pictures are on their own pages, e.g., at the beginnings of the chapters. Positioning pictures to be close to corresponding text is a pain (unless there are some fancy macros I don't know about). Just how to get running headers and footers more than just simple single lines a bit tricky to understand. Something of a pain unless just use the Computer Modern fonts and the AMS symbols and a few more, e.g., the Euler fonts good for more math symbols.
The glory, then, is in what TeX does with mathematical expressions, and there it's just terrific: Just type in stuff, and immediately or soon it looks great. And surprisingly complicated expressions still look great just 'in line' instead of in 'display mode'. I do wish there were more sizes of brackets, etc.!
In my career in math, by far, I mean FAR, FAR^10, the most difficult problem, WAY more difficult than anything else, was JUST getting the math typing done. The math itself, for my Ph.D. dissertation, my published papers, my technical papers, was always MUCH easier than just the typing. The typing for the math was HELL. TeX solved that problem -- now I can do some math, type it in, and have something looks good right away. My main complaint is just that the Computer Modern fonts look WAY too light in PDF.
If someone wants to do another TeX, fine with me. In the meanwhile, for me, TeX makes high quality word whacking a solved problem so that I get to concentrated on other things.