# Are the TeX semantics and grammar defined somewhere in some official documents?

I'm a programmer, I would like to take a look at a more technical and specific definition of what is referred to as LaTeX or TeX.

My interest in on syntax, semantics, and the grammar of this language in general, I also would like a word about the packages which I assume are part of some kind of plugin-like extensible-system and I would also like to know how this interaction is defined.

Thanks.

-
The complete source code of `tex`, with extensive documentation to say the least, is available via the shell command `texdoc tex`. –  Sean Allred Dec 23 '13 at 2:01
Macro expansion, basically. And rules on when they happen. `:)` –  Paulo Cereda Dec 23 '13 at 13:20

Packages are not really plugin-like which usually implies some sort of binary API. They are (mostly) source level inclusion of macro definitions so more like `#include` (if you know the C pre-processor macro system) than anything else.
@user2485710: This might be a good reference for you: tex.stackexchange.com/a/4205/3094 Beware, hic sunt leones. `:)` –  Paulo Cereda Dec 23 '13 at 13:58