We review the topological gauge theory description of Josephson
junction arrays (JJA), fabricated systems which exhibit the superconductor to insulator transition (SIT). This description revealed the topological nature of the phases appearing at the SIT and lead to the discovery of a new state of matter, the superinsulator, characterized by an infinite resistance, even at finite temperature, due to linear confinement of electric charges. This discovery is particularly relevant for the physics of superconducting films with emergent granularity, which are modeled by JJA, and share the same phase diagram.