  Fagin's seminal result characterizing $\mathsf{NP}$ in terms of existential
second-order logic started the fruitful field of descriptive complexity theory.
In recent years, there has been much interest in the investigation of
quantitative (weighted) models of computations. In this paper, we start the
study of descriptive complexity based on weighted Turing machines over
arbitrary semirings. We provide machine-independent characterizations (over
ordered structures) of the weighted complexity classes
$\mathsf{NP}[\mathcal{S}], \mathsf{FP}[\mathcal{S}]$,
$\mathsf{FPLOG}[\mathcal{S}]$, $\mathsf{FPSPACE}[\mathcal{S}]$, and
$\mathsf{FPSPACE}_{poly}[\mathcal{S}]$ in terms of definability in suitable
weighted logics for an arbitrary semiring $\mathcal{S}$. In particular, we
prove weighted versions of Fagin's theorem (even for arbitrary structures, not
necessarily ordered, provided that the semiring is idempotent and commutative),
the Immerman--Vardi's theorem (originally for $\mathsf{P}$) and the
Abiteboul--Vianu--Vardi's theorem (originally for $\mathsf{PSPACE}$). We also
address a recent open problem proposed by Eiter and Kiesel.
