52

Why are there so many programming languages?

And what prompts someone to create a programming languages in spite of the fact that other languages already exist?

Moshe
  • 5,022
  • 2
  • 30
  • 49
  • an entertaining video on this topic is "The last programming language" by Uncle Bob Martin (http://skillsmatter.com/podcast/agile-testing/bobs-last-language) – mikera Nov 25 '11 at 08:18
  • Because programmers like tools. – haylem Nov 14 '12 at 13:20
  • 1
    [Same question](http://cs.stackexchange.com/questions/451/why-are-there-so-many-programming-languages) on [cs.se]. – Kaveh Apr 22 '13 at 19:40
  • 4
    Not unrelated: http://xkcd.com/927/ – Lightness Races in Orbit Jan 18 '15 at 21:59
  • It is difficult to justify this I guess each language has a story. Most languages did not benifit the maker much to my knowledge. Most languages revolve around the same concepts and rarely solve real issues or provide good environments. I think by the time they create it, they feel board and tired of the entire thing and maybe see how they wasted their life.... Think of ksh or JavaScript.....Simply horrible and harmful tools. – NoChance May 12 '19 at 06:21
  • I do not regard this question as unconstructive and voted to reopen. The question is legitimate and a good answer would touch many aspects of the industry and academic world, both current and historical. This will be interesting to almost any IT professional. – Martin Maat May 12 '19 at 07:43
  • You might find this story about earning a lot of money by choosing the better programming language for the job interesting: http://www.paulgraham.com/avg.html – Thorbjørn Ravn Andersen Jun 22 '20 at 22:30

15 Answers15

40

Programming languages evolve

New programming languages often learn from existing languages and add, remove and combine features in a new way. There is a few different paradigms like object oriented and functional and many modern languages try to mix features from them both.

There is also new problems that needs to be solved, e.g. the increase of multi-core CPUs. The most common solution to that have been threads, but some programming languages try to solve the concurrency problem in a different way e.g. the Actor Model. See Erlang - Software for a Concurrent World

l0b0
  • 11,014
  • 2
  • 43
  • 47
Jonas
  • 14,867
  • 9
  • 69
  • 102
  • 11
    What's interesting about Erlang is that it's a "clean room reinvention" of the Actor model. When Armstrong and friends developed Erlang they didn't know about Hewitt et al's work on the Actor model! – Frank Shearar Sep 27 '10 at 12:54
  • @Frank: That's interesting. I didn't know that, thanks. – Jonas Sep 27 '10 at 22:24
  • 2
    +1 for evolution. An analogous question might be "Why are there so many species of animals and plants? Why do new ones still appear?" – Gyan aka Gary Buyn Jun 17 '11 at 00:59
  • 1
    @GaryBuyn that's only a "+1 for evolution" if you subscribe to that viewpoint. For many, the animal analogy is a tiny bit too far. – Darknight Nov 15 '12 at 09:27
  • 1
    @GaryBuyn, Uhm... that's pretty as *analogous* as "hamlet" is to "hamster". – Pacerier Sep 01 '15 at 12:07
24

It is a cycle. You start a new language, and you are free to get away from all of the bad syntax and poor choices from your predecessors. In version 1, the language looks great because it doesn't have any of that baggage, and it gets the job done. Then, in newer versions, you start to experiment with features that may not work out, or you bring in features from other, newer languages that cause your syntax to be a little kludgey. Lo and behold, after a few more versions, you realize that your language is now as complicated as the one you replaced, with silly syntax issues and legacy baggage. And suddenly, you realize that if you created a new language, you could fix all that...

RationalGeek
  • 10,077
  • 7
  • 38
  • 56
  • 2
    This definitely is true for libraries, frameworks and software, but I personally don't know of a language this applies to. Do you have examples? – back2dos Sep 27 '10 at 14:21
  • 17
    Well, I think both C# and Java were introduced at least in part to address complexities with C++. And now, if you look at both of those languages several versions later, their syntax and feature sets are getting complex enough where people are starting to talk about them being "over the hill". Just my take on it though I can't prove anything. :-) – RationalGeek Sep 27 '10 at 14:45
  • 2
    Good point, but i think another fact is at play with C# - it's a commercial product which doesn't exist for charitable reasons and for market acceptance / keeping your customers products have to be "improved" for new releases etc. – g.f Sep 27 '10 at 15:36
  • 1
    This is true. The drive to add new features in order to get more money from the market certainly cannot be ignored. However, it is a double-edged sword. You can expect new features from a commercially-backed product for this exact reason. But from an open source product, you only get new features for as long as the volunteer army stays interested, and there is someone of skill at the helm to herd the cats. – RationalGeek Sep 27 '10 at 16:43
  • C# has plenty of features, but it's still a cleaner language than C++. Newer additions such as LINQ allow you to do things cleanly that you can't easily do in C++. I think it's more likely that there's two kinds of conservation of complexity - one where some complexity is inherent in a problem, and one where as you eliminate one kind of redundant complexity from your programs, the requirements get more complex - complexity, like data, expands to fill the "space" available. –  Jun 17 '11 at 01:15
  • @jkohlhepp - not necessarily, you have to understand most OSS is used by commercial entities, such as IBM, and they employ people to improve them so they have the same benefits as a commercial product. – gbjbaanb Aug 20 '12 at 16:27
  • Isn't the correct way out of the cycle just Lisp? Your DSLs are localized that way :D – Magus May 01 '14 at 22:06
  • Imagine going from c# to ksh or Scheme :) – NoChance May 12 '19 at 06:19
  • @RationalGeek: As far as I know, Java was introduced (at least in part) to address complexities with C++. C# was introduced a few years later as a competitor to Java after Microsoft had tried to produce an incompatible version of Java. – Giorgio May 12 '19 at 07:47
  • Java was originally designed to run untrusted, downloaded code. Somebody saw a usecase in having a browser being able to do exactly that. Then it grew into being suitable for long running server side programs (and primarily that). C# was a Java clone but grew into something else. – Thorbjørn Ravn Andersen Jun 22 '20 at 21:00
12

For the same reason there are hammers, screwdrivers, handsaws, bandsaws, jackhammers, crowbars, and a host of other tools: not every language is perfect for every task. Some languages are targeted at specific problem domains: R is particularly good for statistical analysis, C is particularly good for writing operating system kernels, Haskell is particularly good for math-heavy or financial computations, Erlang is particularly good at concurrent programming, etc.

Also, for the same reason that shirts come in different colors: some people just like the "style" of one language over another.

And, of course, a lot of programmers find it fun to invent a new language, just to see what happens, or perhaps because they have some knowledge about languages and want to scratch an itch, or try out some ideas.

mipadi
  • 7,493
  • 36
  • 35
  • Not only are there all those construction tools, but there are even many different kinds of hammers and hammers that look similar but have specific design factors that make them better for different jobs or users. – Barry Brown Jun 17 '11 at 04:32
  • +1 For suitability for problem domains. The academics who study tools in general say that a very general tool is less powerful than a specific tool for a specific task. Think about an adjustable spanner vs. a fixed size spanner – MarkJ Jun 17 '11 at 08:42
9

Because they all suck (one way or the other).

Right now, we have created about 5000 languages to describe natural problems and none of them are available to write programs (an example would be "English").

Until someone finds a way to create a programming language that can express what you can express in a sentence in a natural language, they will keep coming.

Aaron Digulla
  • 2,865
  • 21
  • 22
  • 17
    Even then, they will keep coming. Only dead languages are written in stone, pardon the pun. There is a reason living languages are constantly changing. – R. Martinho Fernandes Sep 27 '10 at 17:15
  • 1
    Some would claim that the natural language to express problems is math. This raises the question of why people keep adding syntactic sugar to functional languages rather than using the pure lambda calculus. I think the problems we have to routinely solve often aren't easily expressed in either English or math either. –  Jun 17 '11 at 01:18
  • 5
    Agreed. It's so hard to express "I'm hungry" using pure math. – Aaron Digulla Jun 20 '11 at 07:32
  • 1
    @AaronDigulla : hungry = sum(belly/food) surely :) – gbjbaanb Aug 20 '12 at 16:31
  • @AaronDigulla that's a good example, often you want to express computation. So we take a given scenario like: I'm hungry , now eat -> fine, now not eat -> starve . To build systems beeing able to negotiate or expand context I think that's the goal of AI. Normal programing languages only express what people tell them what they should do and usually that's rather specific than general. But since most problems are themselves specific you may see the problem here. – AndreasScheinert Nov 15 '12 at 09:03
  • @AndreasScheinert: AI is just one small part of the solution. We need languages which allow to express simple things like editing persistent data with only a few lines of code. – Aaron Digulla Nov 15 '12 at 09:46
  • Editing persistent data with few? Lines of code? That seems like a strange requirement to me, maybe you can expand on this. Basically with AI we could move from our current : make & fix approach, to a grow & negotiate one. It would make programming and PL as we perceive them today make obsolete (to a certain extend) – AndreasScheinert Nov 17 '12 at 13:31
  • @AndreasScheinert: Okay, I mean "AI" as in "real AI" as we have today which are too dumb/primitive to really help. Also, you will need an efficient way to negotiate with your AI. And that would be a new PL. – Aaron Digulla Nov 19 '12 at 10:49
  • Actually I think math could be sufficent – AndreasScheinert Nov 19 '12 at 13:36
  • It might be if we ever get an editor for programs that's not limited to plain text. – Aaron Digulla Nov 19 '12 at 14:25
6

Obviously one important motivation for creating a new language is to achieve something better than the already existing languages. And as there is always room for improvement, there will always be new languages.

Commercial interests are another big reason. I believe it is important for example Microsoft that they can offer a language for every need so companies and developers prefer their platforms.

Carlos
  • 1,479
  • 1
  • 12
  • 17
6

Legacy Code. If you start a new language you don't have to listen/consider all the complaints when you change an old language. Even if everyone agrees that the new implementation is better, it can't break the old code. And there is a lot of old code out there.

JeffO
  • 36,816
  • 2
  • 57
  • 124
  • 3
    Is there any documented case of a language being designed to avoid legacy code? This claim seems highly unlikely. I can see the case where you want to start fresh (.net comes to mind) but it's not so much to avoid legacy code but to better enable future code. – Bryan Oakley Jun 16 '11 at 23:49
  • I don't believe that this correct. Its (usually) possible to fork an open source implementation of an existent language. – alternative Jun 16 '11 at 23:51
  • @BryanOakley - originally .NET was intended to keep backward compatibility with VB6, but they decided it was too hard a problem. .NET still had a lot of legacy WRT Java/J++ that it was based on. I think D is an example of a language designed against legacy code. – gbjbaanb Aug 20 '12 at 16:28
5

because it's fun to create new languages even if they have no real use

An esoteric programming language (sometimes shortened to esolang) is a programming language designed to test the boundaries of computer programming language design, as a proof of concept, or as a joke.

jk.
  • 10,216
  • 1
  • 33
  • 43
  • 1
    For those who didn't get down to the footnotes in the wikipedia article, the esoteric languages wiki is a lot of fun: http://esoteric.voxelperfect.net/wiki/Main_Page – David Winslow Feb 15 '11 at 01:15
  • would you mind explaining more on what it does and why do you recommend it as answering the question asked? ["Link-only answers"](http://meta.stackoverflow.com/tags/link-only-answers/info "what's this") are not quite welcome at Stack Exchange – gnat Sep 26 '13 at 09:18
  • 1
    @gnat I honestly think the original text is not a link only answer, it would stand as a short but perfectly valid answer without the link. But given that the link does add flavour, I've included a short quote from it. – jk. Sep 26 '13 at 09:46
3

Creating a programming language is rather fun. It's close to pure creative work, since you aren't limited to previous requirements. It's not that difficult to implement any more, since you can always compile to C and compile the C code for adequate performance if you're writing a compiler in the first place.

Of course, most of us have fewer good ideas than we think we have, so they often wind up being disappointing, or not being loved by anybody other than the original designer.

Think about any programming language you know. You can easily come up with several things you dislike about it, right? You presumably have ideas how those could be fixed. With just a little more impetus, assuming you know much about compiler building (and lots of people do), you might start designing and even implementing your own.

David Thornley
  • 20,238
  • 2
  • 55
  • 82
2

Quick Short Answer

Reinventing The Wheel ... What is the current trend ...

Boring Long Answer

Many people forget that "another similar new language for old programmers" is "a plain new language for new programmers".

What do I mean for that ?

Well, for "several years" programmers, Java or C# may be an additional programming languages to existing Cobol, (O.O./Procedural) Basic, C/C++, while for "new" programmers, Java or C# are new languages, while Cobol, (O.O./Procedural) Basic, C/C++ doesn't exist for them, so reinventing the wheel becomes a common thing ...

And, if there is a new trend on technology, people may make a new programming language based on that trend, like ecmascript / javascript for the web and functional programming ...

Cheers.

umlcat
  • 2,146
  • 11
  • 16
  • +1 for pointing out the reinventing-the-wheel aspect. Often it is done for marketing reason: any big-enough company or organization must have their own programming language. – Giorgio May 12 '19 at 07:58
1

new programming languages are built for many different reasons, mostly because there are new programming paradigm, or because of advances in hardware people create new language to take advantage of the new hardware features like multitasking, etc.

in my case, I usually build small compilers( with a new programming language), for specialty reason. if I make allot of games, and I believe that a programming language specifically made for game development will result in smaller faster code and faster development turn around, then I build it. and at then end it turns out that it can also be used for other general purpose programming.

I think most people who create programming languages have a specific purpose in mind, there are those who create them for general purpose from the beginning. but most are not.

By the way, I do think there are way too many programming languages, but hundred of new ones will always come out. some out of fun, some out of a niche purpose, as a school project, or for hundreds of other reasons. and sooner or later a new one will become popular. Its never going to end.

gnat
  • 21,442
  • 29
  • 112
  • 288
0

There are a few reasons, most are because people think that what exists does not make it easy to solve some set of problems. Some are just for fun or for academic interest.

I think there is a solid argument that the issue of how you design the perfect language is not yet solved (and may never be). So as long as people have new ideas on what would make a great language people will keep trying. Some of those tries will map out cool new space like Erlang and some will flop, but as long as something is learned from the flop that is OK too.

Zachary K
  • 10,433
  • 2
  • 37
  • 55
0

For the same reason there are so many <whatever> and we keep creating new <whatever>

There are a dozen PHP MVC frameworks, for example, but people will always create new ones to fill specific needs, to avoid becoming dependent on some other team, or just to try and create something better. The same holds true for basically every type of tool or application.

It's a very good thing, pretty much a win-win for everyone in my opinion.

Fosco
  • 1,671
  • 14
  • 19
0

Universities contribute a lot of programming languages, and so do very large corporations like Ericsson (Erlang = Ericsson language), Bell Labs (B and C languages), Google (Go language as of a few months prior). Many of the ones that were written as part of university research aren't used much. There are a few notable exceptions, though. I suppose writing your own language/compiler makes a good topic for PhD theses of people studying CS Theory or related disciplines. It strikes me that Python is one of the first languages to be born out of the collaborative online effort of various programmers around a single idea.

ixtmixilix
  • 300
  • 2
  • 8
  • http://python-history.blogspot.com/2009/01/personal-history-part-1-cwi.html describes the birth of Python in detail – Andy Dent Sep 28 '10 at 04:32
-1

Like previously stated, languages try to target certain specific tasks and the new languages might target a new area. These languages can take features from other languages that are currently out.

Another reason for new languages is trying to incorporate many different tasks and to be the language of choice for many different needs. Some of these languages are trying to be all encompassing languages that you would always use, no matter the need you have.

sange
  • 892
  • 6
  • 9
-1

I learned in my programming languages class that most languages were invented to scratch an itch. Most languages were invented to be able to express some set of algorithms better. For instance, functional languages were invented to give recursive algorithms a much more expressive space.

Asking why are there so many languages is like asking why C++0x? :)

Plus, the more languages you know, the more expressive you can become - this is true in both programming and natural languages!

2rs2ts
  • 515
  • 1
  • 6
  • 11