Stacks have a number of applications in computer science and programming. Stacks also form the basis for some computing machine components, and operating systems utilize stacks when running programs.
One of the oldest uses for a stack is in theoretical computer science. The simplest machines are called "finite control" or "finite state" machines. These simple machines have a set of states (and a set of rules for changing states) but no memory. Finite controls have many uses, but are quite limited in their computational capability. The simplest form of memory to add to a finite state machine is stack memory. A finite control with stack memory is called a "pushdown automaton."
Pushdown automota have the power to recognize a class of languages called "context free grammars." Hence, stacks have application in compilers, as we will see in some examples.