# How TeX places text horizontally and vertically?

Am I right that TeX processes text in a manner like this? Since the very first character it is forming an hbox of textwidth width. When the first hbox is filled in its width, TeX makes a hyphenation, adds this hbox to a vbox (for a paragraph) and starts to form the second hbox and so on. So the vbox is like a holder for several hbox'es (lines)? Is it like a vertical linked list of horizontal linked lists?

Below is an illustration of what I want to clarify. In the first line it makes an indent and hyphens as ma-chines. In the second one I tried to explicitly represent this. Does TeX do the same (ideologically)?

\documentclass{article}

\begin{document}
Computer science is the study of algorithmic processes, computational machines and computation itself.

\vbox{%
\hbox{\indent Computer science is the study of algorithmic processes, computational ma-}%
\hbox{chines and computation itself.}}
\end{document}


No TeX does not typeset line by line. Once a paragraph starts, horizontal mode is entered and the entire paragrah is set in a horizontal list (similar to an \hbox) then the entire paragraph is passed through a line breaking algorithm that does a least cost optimisation trying to minimise badness (actually, demerits) of the paragraph. The resulting sequence of hboxes and vertical glue and penaltiues is then added to a similarly infinite vertical list and later a similar but simpler algorithm splits a page off this main vertical list.