  A bialgebra is a structure which is simultaneously an algebra and a
coalgebra, such that the algebraic and coalgebraic parts are "compatible".
Bialgebras are normally studied over a field or commutative ring. In this
paper, we show how to apply the defining diagrams of algebras, coalgebras, and
bialgebras to categories of semimodules and semimodule homomorphisms over a
commutative semiring. We then show that formal language theory and the theory
of bialgebras have essentially undergone "convergent evolution", with the same
constructions appearing in both contexts. For example, formal languages
correspond to elements of dual algebras of coalgebras, automata are "pointed
representation objects" of algebras, automaton morphisms are instances of
linear intertwiners, and a construction from the theory of bialgebras shows how
to run two automata in parallel. We also show how to associate an automaton
with an arbitrary algebra, which in the classical case yields the automaton
whose states are formal languages and whose transitions are given by language
differentiation.
