Besides graphite, diamond, graphene, carbon nanotubes, and fullerenes, there is another allotrope of carbon, carbyne, existing in the form of a one-dimensional chain of carbon atoms. It has been theoretically predicted that carbyne would be stronger, stiffer, and more exotic than other materials that have been synthesized before. In this article, two kinds of carbyne, i.e., cumulene and polyyne are investigated by the first principles, where the mechanical properties, electronic structure, optical and phonon properties of the carbynes are calculated. The results on the crystal binding energy and the formation energy show that though both are difficult to be synthesized from diamond or graphite, polyyne is more stable and harder than cummulene. The tensile stiffness, bond stiffness, and Young's modulus of cumulene are 94.669 eV/Å, 90.334 GPa, and 60.62 GPa, respectively, while the corresponding values of polyyne are 94.939 eV/Å, 101.42 GPa, and 60.06 GPa. The supercell calculation shows that carbyne is most stable at N=5, where N is the supercell number, which indicates that the carbon chain with 10 atoms is most stable. The calculation on the electronic band structure shows that cumulene is a conductor and polyyne is a semiconductor with a band gap of 0.37 eV. The dielectric function of carbynes varies along different directions, consistent with the one-dimensional nature of the carbon chains. In the phonon dispersion of cumulene, there are imaginary frequencies with the lowest value down to-3.817 THz, which indicates that cumulene could be unstable at room temperature and normal pressure.