It seems someone's already done
something similar to
what I mentioned a while ago, namely rewriting TEX (or something like it) as an embedded DSL in Caml or some such, so that extensions could be written in a Real Programming Language (and so that other DSLs could be embedded more easily). It's troff rather than TEX, and Scheme rather than Caml, but the principle is much the same. I haven't tried it yet: I wonder if it's any good? I've never used troff, but I like
the way it handles minilanguages for embedded pictures, equations and so on.
I've almost finished reading Leslie Lamport's LATEX manual (I really don't know why it's taken me so long) and I'm about to start on The TEXBook. My rationale is that if I'm going to be an academic I should know how to use TEX properly; this will involve reading the TEXBook through at some point, and I might as well do it now. I look forward to finding out what, if anything, LATEX actually brings to the TEX experience...