The growth of diamond and graphite from the gas phase