  Classical spin Hamiltonians are a powerful tool to model complex systems,
characterised by a local structure given by the local Hamiltonians. One of the
best understood local structures is the grammar of formal languages, which are
central in computer science and linguistics, and have a natural complexity
measure given by the Chomsky hierarchy. If we see classical spin Hamiltonians
as languages, what grammar do the local Hamiltonians correspond to? Here we
cast classical spin Hamiltonians as formal languages, and classify them in the
Chomsky hierarchy. We prove that the language of (effectively) zero-dimensional
spin Hamiltonians is regular, one-dimensional spin Hamiltonians is
deterministic context-free, and higher-dimensional and all-to-all spin
Hamiltonians is context-sensitive. This provides a new complexity measure for
classical spin Hamiltonians, which captures the hardness of recognising spin
configurations and their energies. We compare it to the computational
complexity of the ground state energy problem, and find a different
easy-to-hard threshold for the Ising model. We also investigate the dependence
on the language of the spin Hamiltonian. Finally, we define the language of the
time evolution of a spin Hamiltonian and classify it in the Chomsky hierarchy.
Our work suggests that universal spin models are weaker than universal Turing
machines.
