The band structure, density of states, optical properties, effective masses and loss function of AlxGa1-xAs and InyGa1-yAs were performed by the first-principles method within the local density approximation. The calculated direct band gap of the AlAs, Al0.5Ga0.5As, GaAs, In0.5Ga0.5As and InAs were 1.608 eV, 1.34eV, 1.02eV, 0.646eV and 0.316eV at G point, which were direct bandgap semiconductor materials. In addition, dielectric functions, the absorption function, refractive index, loss function and effective mass were analyzed in detail. The effective masses of AlxGa1-xAs and InyGa1-yAs were small, so they have high carrier mobility. These results make them to be promising candidates for future electronics.