Diffusion into or out of group IV semiconductors