Diffractive gratings in high-precision interferometry for gravitational wave detection