Optical pulse compression with diffraction gratings