r/AskComputerScience • • Aug 04 '20

Why so many computer programming languages?

Is it possible to do everything with one language like Python or C++?

I am wondering why there is so many different programming languages.

55 Upvotes

33 comments sorted by

View all comments

2

u/[deleted] Aug 04 '20 edited Aug 04 '20

Yes it is possible to do everything in a single language as long as it is Turing Complete.

However, that is not a good idea, different use cases need different languages.

For example, few languages support differentiable programming, also it is very easy to get lost in the chaos when there aren't good abstractions. Python for example allows researchers to do their computations fast because they can leverage C under the hood without worrying about optimizations because the solutions tend to be fast enough.

In contrast, GameDevs want control over everything to leverage as much performance from the hardware.

Other systems need to be able to spawn multiple processes for cheap, without interference, or, if one breaks, to avoid crashing the whole program, e.g. Erlang allows this.

Other cases include parallel computation. With a pure language, you don't have to worry about state because the objects are immutable, this enables you to fearlessly parallelize operations such as map.

Furthermore, you need low level access for stuff, this is where C comes in, because C is almost like assembly, if you know your C and your x86, you know what cc -S produces.

Last but not least, we also need verification, imagine how powerful the ability to prove that a program is correct is. Some languages allow just that and are the de-facto languages for airplains or rockets.

-1

u/agree-with-you Aug 04 '20

I agree, this does seem possible.