Just about anything….boredom, innovation or necessity. HTML was invented because there was a need to make the newfangled WWW user-friendly compared to BBSs and Listserves. Some languages are invented to fill a mathematical niche, or a design niche, a technology niche, you name it. Some are invented just for fun or out of boredom, like most codegolf languages. Some are innovated to build on the model and successes of older languages and make them more usable/optimized for newer applications, like c++ –> Java. All depends.
People.
Programmer A doesn’t like Programming Language X for [insert reason].
So they create a new programming language, Programming Language Y, that they believes solves the [insert reason] problem with Programming Language X.
Then along comes Programmer B who decides they don’t like Programming Language Y because [yet another reason], so they create Programming Language Z.
And so on and so on. The cycle continues.
The same as: Why we done have only Ford cars. Or, why there are other electric cars than Tesla?
People trying to create something different sometimes simple or sometimes more sophisticated. With other specialization, or to achieve one effect with one and absolutely different with other.
Why we don’t use a Lambo to deliver a concrete?
Someone writes a compiler or interpreter for it. Basically: someone writes a program that takes source from the new language they just invented, and either turns it into code a machine can run (that’s a compiler) or the program runs the code itself line by line (an interpreter).
For example: the python programming language is almost always run by using the most popular implementation [CPython](https://en.wikipedia.org/wiki/CPython). CPython itself is just a program written in C that reads in python source code and executes it.
Sometimes it’s licensing cost. Linux exists because Unix was ~~a very expensive system to purchase and maintain~~ unavailable – see EDIT, so Linus Torvald tore the lid off.
EDIT: From u/Sol33t303 in the comments, apparently it was a matter of legal tie ups.
This happens with other software as well – Audacity is a free audio app that has displaced most others, *very* expensive word processing systems were kicked aside by a freeware program called PC-Write and so on. Google has continued the act (as have others) with suites of apps that displace paid ones for most everyday uses.
A language like C or C++ is very portable, it runs on just about every single architecture (different microcontrollers, operating systems, etc.).
It provides near complete control of the processor and its features and can be optimized for speed or size at the expense of being extremely verbose and environment-aware.
Something like JavaScript, runs in fewer environments and you’re often at the mercy of the browser or other environment hosting the javascript environment, but it’s very well suited to manipulating elements on a web page and making HTTP requests.
Pretty much every time a new processor architecture comes along compilers are adapted so existing languages can be used on the new hardware. Once in a while an enterprising person or team decides to write a new compiler or interpreter to make their lives or tasks easier. Nearly all application teams develop API methods, data structures, objects, etc. in what becomes a functional application dialect of whatever industry they wrote code for, often merging or using industry specific terms and acronyms in the dialect. While this does not constitute a “language” that code gets compiled in, it begins to resemble a local cultural slang dialect. It’s pretty interesting when you realize we as software developers we spend so much time translating terms from one language to another.
Latest Answers