  Using first-principles calculations we examine the crystal structures and
phase transitions of nitride perovskite LaWN$_3$. Lattice dynamics calculations
indicate that the ground-state structure belongs to space group $R3c$. Two
competitive phase transition pathways are identified which are characterized by
symmetry-adapted distortion modes. The results suggest that $R3c$ LaWN$_3$
should be an excellent ferroelectric semiconductor: its large spontaneous
polarization of around 61 $\mu$C/cm$^2$ is comparable to that of PbTiO$_3$, and
its band gap is about 1.72 eV. Ferroelectricity is found to result from the
\emph{B}-site instability driven by hybridization between W-5$d$ and N-2$p$
orbitals. These properties make LaWN$_3$ an attractive candidate material for
use in ferroelectric memory devices and photovoltaic cells.
