TeX is a typesetting system written by Donald E. Knuth, who says in the Preface to his book on TeX (see TeX-related books) that it is ``intended for the creation of beautiful books-and especially for books that contain a lot of mathematics''.
Knuth developed a system of `literate programming' to write TeX,
and he provides the literate (WEB) source of TeX free of charge,
together with tools for processing the web
source into something
that can be compiled and something that can be printed; there's never
any mystery about what TeX does. Furthermore, the WEB system
provides mechanisms to port TeX to new operating systems and
computers; in order that one may have some confidence in the ports,
Knuth supplied a test by means of which one may judge the fidelity of
a TeX system. TeX and its documents are therefore highly
portable.
TeX is a macro processor, and offers its users a powerful
programming capability. For this reason, TeX on its own is a
pretty difficult beast to deal with, so Knuth provided a package of
macros for use with TeX called plain
TeX; plain
TeX is
effectively the minimum set of macros one can usefully employ with
TeX, together with some demonstration versions of higher-level
commands (the latter are better regarded as models than used as-is).
When people say they're ``programming in TeX'', they usually mean
they're programming in plain
TeX.