<p>Designing and implementing a programming language (and maintaining it) is a lot of effort, so there must be a good reason to make it worth doing. Other than &quot;just because I can&quot;, what is people's motivation to do it? Are existing (common) languages maybe not performant or concise enough for certain types of tasks?</p>
<p><em>(This question may be a bit on the broad side; still, I feel it should be possible to categorize those reasons into 3-5 different groups. Examples are good (perhaps even necessary) but if the motivation for a language is similar to one mentioned in an existing answer, it's better to add it there.)</em></p>

<motivation>
What are the common reasons to create a new programming language?
<p>Often, new languages are merely improvements over older ones, for example in speed, new features, etc. This makes sense because computer science is a never-ending subject. C++ was created to improve C by adding classes, TypeScript improved JavaScript, and there are many more examples. Go find some out on the web (and tell me!).</p>
<p>There are also languages created for educating others on basic programming. Some languages were created to help educate young people. Logo and Scratch &amp; ScratchJr are good examples of this. These are usually created by teams of programmers not intending to profit for themselves, like the creators of Scratch.</p>

CC BY-SA 4.0
2023-05-18T13:59:24.467Z
2023-05-21T07:43:38.577Z
2023-05-21T07:43:38.577Z
SectorCorruptor
CC BY-SA 4.0
2023-05-18T14:27:41.657Z
Another example of an improvement is TypeScript made as a superset of JavaScript
Jacob
<h1>Because there is no other &quot;good&quot; choice</h1>
<p>Some languages are made because there is no other “good” (from the viewpoint of the author) languages to be used. For example, I really like embedded scripting, but Lua is a bit… meh to me. For that reason, I’m currently implementing a much more solid language that transpiles to Lua. That way, I can use the features of the languages I love with the popularity of the Lua scripting platform.</p>

CC BY-SA 4.0
2023-05-18T14:12:57.653Z
2023-05-19T21:31:32.333Z
2023-05-19T21:31:32.333Z
Seggan
<p>There are various motivations, depending on the kind of language and the person designing them. Here are a few of mine:</p>
<ul>
<li>Programming language design and implementation are inherently interesting activities; they are rewarding for their own sake.</li>
<li>Designing and implementing a language can help you to understand why existing languages behave the way they do, and why they have certain limitations.</li>
<li>Sometimes you have an idea for a language which works differently to how existing languages work, and you want to find out what it would be like to use such a language.</li>
<li>Sometimes you have a specific kind of problem which there is no convenient solution to using a general purpose language, so you want to design a specialised language for solving that kind of problem. This might be a <a href="https://en.wikipedia.org/wiki/Domain-specific_language" rel="noreferrer">domain-specific language</a>.</li>
<li>Sometimes an existing language inspires you and you have ideas for how it could be improved, but your ideas would be too much of a radical change to contribute them to the existing project.</li>
<li>Sometimes there is a (very funny) joke you want to tell, and the joke happens to be a programming language.</li>
</ul>

CC BY-SA 4.0
2023-05-18T14:03:06.387Z
2023-05-18T14:03:06.387Z
kaya3
<h1>Learning</h1>
<p>Many languages are merely hobby languages. Often times the creator may have taken it up as a learning experience to gain knowledge into the field of compiler development. Many universities offer compiler courses as it still is a vital component of computer science.</p>
<p>These 'toy' languages can be a good way to play around with a certain concept or feature. Oftentimes, a simple compiler or even interpreter could make for a good weekend project.</p>

CC BY-SA 4.0
2023-05-18T13:46:30.570Z
2023-05-18T14:00:05.920Z
2023-05-18T14:00:05.920Z
FireTheLost
CC BY-SA 4.0
2023-05-18T14:10:18.480Z
Some hobby languages have even become used by the wider world (I wouldn’t be surprised if JavaScript was someone’s hobby esolang :P)
Seggan
CC BY-SA 4.0
2023-07-01T12:25:28.513Z
The history of JavaScript is even weirder than that. Brendan Eich was hired to implement a scripting language for Netscape, but he was specifically hired because of his expertise in implementing Scheme dialects and that was what he was told he would do, and what he originally started out to do. However, one of the execs had heard of this thing called "object-oriented" and that "every real language must have curly braces", and so Eich was ordered to create a language which looks like C++ and is object-oriented, and oh by the way, he has 12 days. So, the did the simplest thing he could, swap …
Jörg W Mittag
CC BY-SA 4.0
2023-07-01T12:27:14.833Z
… the ubiquitous single data structure from Scheme's list to a dictionary, throw out homoiconicity and macros for a C++-like syntax, and bolt the simplest possible object model he could find (a prototype-based model based on NewtonScript and Act-1) onto it. But fundamentally, JavaScript is still very much Scheme-like with everything revolving around procedures and closures. Given its origins, it is actually amazing *how good* JavaScript is. Consider that Smalltalk, a language of similar complexity, took 10 *years* to design!
Jörg W Mittag
CC BY-SA 4.0
2023-07-01T12:47:14.337Z
CoffeeScript might be a good example. It was created by Jeremy Ashkenas as an exercise after reading [*How To Create Your Own Freaking Awesome Programming Language*](http://createyourproglang.com/) by Marc-André Cournoyer.
Jörg W Mittag
<h2>Constrained domain-specific need</h2>
<p>When you have an application that is large enough, you may need to make it more dynamic. For the sake of the example, let's say it needs some rules to respond to and you do not want to change the source code any time a new rule comes in. You need to change them at runtime.</p>
<p>One option is to use an existing language for that. An example is Lua which is often used as an embedded scripting language in application. However, that might give <em>too much</em> flexibility. Maybe you need a way to only handle some logical checks, in which case a programming can be created that allows expressing various bits of logic but does not allow, say, loops and recursion. Constraining the language can avoid <a href="https://en.wikipedia.org/wiki/Halting_problem" rel="noreferrer">the halting problem</a> and keep the rule easy to analyse. This can thus be exposed to users to use and affect how the program behaves without involving developers into the process.</p>
<p>Further, by keeping the language domain-specific, it allows more <em>domain-specific expressiveness</em>. A general language like Lua can do many things, however, if the application you have deals specifically with the economics field, the language can be tailored so that it is more familiar to economists to reduce the learning curve.</p>

CC BY-SA 4.0
2023-05-18T14:04:42.947Z
2023-05-18T14:04:42.947Z
VLAZ
<ul>
<li><p>To create an &quot;evolved&quot; version of an existing language:</p>
<ul>
<li>To be free of old baggage that an existing language may not have the privilege of changing without large and unacceptable disruptions to the language's tooling and library ecosystem and users, or without violating fundamental design goals.
<ul>
<li>Examples: <a href="https://github.com/carbon-language/carbon-lang" rel="nofollow noreferrer">Carbon</a>, (to a degree,) <a href="https://github.com/hsutter/cppfront" rel="nofollow noreferrer">Cppfront</a></li>
</ul>
</li>
<li>To address any other well-known and understood pain-points in existing languages in the same problem/application-domain
<ul>
<li>Examples: TypeScript</li>
</ul>
</li>
</ul>
</li>
<li><p>To solve an unsolved problem:</p>
<ul>
<li>A completely unsolved problem (Ex. in a specific problem/application-domain, or a programming paradigm with no supporting / capable-of-supporting languages)</li>
<li>A problem solved in ways that one finds unsatisfactory, or with tradeoffs that one wants other tradeoff made for instead.
<ul>
<li>Examples: Jai</li>
</ul>
</li>
</ul>
</li>
<li><p>To tackle a specific class of problems in a potentially more optimal way than is possible with existing, more general-purpose languages.</p>
<ul>
<li>Example: domain-specific languages (see also <a href="https://codegolf.meta.stackexchange.com/a/1071/115091">the shenanigans people get up to in the code-golfing world</a>)</li>
</ul>
</li>
<li><p>For fun and/or <strike>profit</strike> learning.</p>
<ul>
<li>Examples: some esoteric languages</li>
</ul>
</li>
<li><p>Because someone who pays you money told you to do it.</p>
<ul>
<li>Examples: JavaScript(?)</li>
</ul>
</li>
<li><p>To jump on a PL hype train.</p>
<ul>
<li>Examples: C# (or so I've heard from reading humour-slanted statements about C#), <a href="https://chat.stackexchange.com/transcript/message/63539514#63539514">possibly</a>(<a href="https://chat.stackexchange.com/transcript/message/63539917#63539917">?</a>) Mojo</li>
</ul>
</li>
</ul>
<p>Note that not all modifications need to be big / dramatic. Language dialects are a thing too, and can be created for similar reasons.</p>

CC BY-SA 4.0
2023-05-19T10:17:46.757Z
2023-05-19T21:34:29.867Z
2023-05-19T21:34:29.867Z
starball
CC BY-SA 4.0
2023-05-19T10:23:02.487Z
feel free to suggest additions to the lists of examples (preferably with links to writing explaining why)
starball
<h2>Wanting to use the best parts from 2 or more languages</h2>
<p>Wouldn't it be nice to have Python style syntax but C like speed?<br />
Wouldn't it be nice to Rust-style type safety but no compile times?<br />
Wouldn't it be nice to have Node but with strong guarantees of purity and automatic multi-threading like Elixir?</p>
<p>All languages have things I like and things I don't like. Wouldn't it be nice to just have the strengths of all many languages and none of the weaknesses?</p>
<p>Well you can, kind of. Unfortunately you'll introduce more weaknesses but at least they'll be different from those in languages you are used to.</p>

CC BY-SA 4.0
2023-05-18T14:45:56.993Z
2023-05-18T14:47:13.393Z
2023-05-18T14:47:13.393Z
mousetail 'he-him'
# What are the common reasons to create a new programming language?
Posted by: username_0 on 2023-05-18
Designing and implementing a programming language (and maintaining it) is a lot of effort, so there must be a good reason to make it worth doing. Other than "just because I can", what is people's motivation to do it? Are existing (common) languages maybe not performant or concise enough for certain types of tasks?

*(This question may be a bit on the broad side; still, I feel it should be possible to categorize those reasons into 3-5 different groups. Examples are good (perhaps even necessary) but if the motivation for a language is similar to one mentioned in an existing answer, it's better to add it there.)*
**Tags:** motivation
---
## 7 answers
### Answer by username_4 on 2023-05-18. Score: 10
There are various motivations, depending on the kind of language and the person designing them. Here are a few of mine:

* Programming language design and implementation are inherently interesting activities; they are rewarding for their own sake.
* Designing and implementing a language can help you to understand why existing languages behave the way they do, and why they have certain limitations.
* Sometimes you have an idea for a language which works differently to how existing languages work, and you want to find out what it would be like to use such a language.
* Sometimes you have a specific kind of problem which there is no convenient solution to using a general purpose language, so you want to design a specialised language for solving that kind of problem. This might be a [domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language).
* Sometimes an existing language inspires you and you have ideas for how it could be improved, but your ideas would be too much of a radical change to contribute them to the existing project.
* Sometimes there is a (very funny) joke you want to tell, and the joke happens to be a programming language.
---
### Answer by username_5 on 2023-05-18. Score: 9
# Learning

Many languages are merely hobby languages. Often times the creator may have taken it up as a learning experience to gain knowledge into the field of compiler development. Many universities offer compiler courses as it still is a vital component of computer science.

These 'toy' languages can be a good way to play around with a certain concept or feature. Oftentimes, a simple compiler or even interpreter could make for a good weekend project.
> **Comments:**
> **username_3** (2023-05-18): Some hobby languages have even become used by the wider world (I wouldn’t be surprised if JavaScript was someone’s hobby esolang :P)  
> **username_6** (2023-07-01): The history of JavaScript is even weirder than that. Brendan Eich was hired to implement a scripting language for Netscape, but he was specifically hired because of his expertise in implementing Scheme dialects and that was what he was told he would do, and what he originally started out to do. However, one of the execs had heard of this thing called "object-oriented" and that "every real language must have curly braces", and so Eich was ordered to create a language which looks like C++ and is object-oriented, and oh by the way, he has 12 days. So, the did the simplest thing he could, swap …  
> **username_6** (2023-07-01): … the ubiquitous single data structure from Scheme's list to a dictionary, throw out homoiconicity and macros for a C++-like syntax, and bolt the simplest possible object model he could find (a prototype-based model based on NewtonScript and Act-1) onto it. But fundamentally, JavaScript is still very much Scheme-like with everything revolving around procedures and closures. Given its origins, it is actually amazing *how good* JavaScript is. Consider that Smalltalk, a language of similar complexity, took 10 *years* to design!  
> **username_6** (2023-07-01): CoffeeScript might be a good example. It was created by Jeremy Ashkenas as an exercise after reading [*How To Create Your Own Freaking Awesome Programming Language*](http://createyourproglang.com/) by Marc-André Cournoyer.  
---
### Answer by username_9 on 2023-05-18. Score: 7
## Wanting to use the best parts from 2 or more languages

Wouldn't it be nice to have Python style syntax but C like speed?  
Wouldn't it be nice to Rust-style type safety but no compile times?  
Wouldn't it be nice to have Node but with strong guarantees of purity and automatic multi-threading like Elixir?

All languages have things I like and things I don't like. Wouldn't it be nice to just have the strengths of all many languages and none of the weaknesses?

Well you can, kind of. Unfortunately you'll introduce more weaknesses but at least they'll be different from those in languages you are used to.
---
### Answer by username_7 on 2023-05-18. Score: 6
## Constrained domain-specific need

When you have an application that is large enough, you may need to make it more dynamic. For the sake of the example, let's say it needs some rules to respond to and you do not want to change the source code any time a new rule comes in. You need to change them at runtime.

One option is to use an existing language for that. An example is Lua which is often used as an embedded scripting language in application. However, that might give *too much* flexibility. Maybe you need a way to only handle some logical checks, in which case a programming can be created that allows expressing various bits of logic but does not allow, say, loops and recursion. Constraining the language can avoid [the halting problem](https://en.wikipedia.org/wiki/Halting_problem) and keep the rule easy to analyse. This can thus be exposed to users to use and affect how the program behaves without involving developers into the process.

Further, by keeping the language domain-specific, it allows more *domain-specific expressiveness*. A general language like Lua can do many things, however, if the application you have deals specifically with the economics field, the language can be tailored so that it is more familiar to economists to reduce the learning curve.
---
### Answer by username_8 on 2023-05-19. Score: 5
* To create an "evolved" version of an existing language:

  + To be free of old baggage that an existing language may not have the privilege of changing without large and unacceptable disruptions to the language's tooling and library ecosystem and users, or without violating fundamental design goals.
    - Examples: [Carbon](https://github.com/carbon-language/carbon-lang), (to a degree,) [Cppfront](https://github.com/hsutter/cppfront)
  + To address any other well-known and understood pain-points in existing languages in the same problem/application-domain
    - Examples: TypeScript
* To solve an unsolved problem:

  + A completely unsolved problem (Ex. in a specific problem/application-domain, or a programming paradigm with no supporting / capable-of-supporting languages)
  + A problem solved in ways that one finds unsatisfactory, or with tradeoffs that one wants other tradeoff made for instead.
    - Examples: Jai
* To tackle a specific class of problems in a potentially more optimal way than is possible with existing, more general-purpose languages.

  + Example: domain-specific languages (see also [the shenanigans people get up to in the code-golfing world](https://codegolf.meta.stackexchange.com/a/1071/115091))
* For fun and/or profit learning.

  + Examples: some esoteric languages
* Because someone who pays you money told you to do it.

  + Examples: JavaScript(?)
* To jump on a PL hype train.

  + Examples: C# (or so I've heard from reading humour-slanted statements about C#), [possibly](https://chat.stackexchange.com/transcript/message/63539514#63539514)([?](https://chat.stackexchange.com/transcript/message/63539917#63539917)) Mojo

Note that not all modifications need to be big / dramatic. Language dialects are a thing too, and can be created for similar reasons.
> **Comments:**
> **username_8** (2023-05-19): feel free to suggest additions to the lists of examples (preferably with links to writing explaining why)  
---
### Answer by username_1 on 2023-05-18. Score: 2
Often, new languages are merely improvements over older ones, for example in speed, new features, etc. This makes sense because computer science is a never-ending subject. C++ was created to improve C by adding classes, TypeScript improved JavaScript, and there are many more examples. Go find some out on the web (and tell me!).

There are also languages created for educating others on basic programming. Some languages were created to help educate young people. Logo and Scratch & ScratchJr are good examples of this. These are usually created by teams of programmers not intending to profit for themselves, like the creators of Scratch.
> **Comments:**
> **username_2** (2023-05-18): Another example of an improvement is TypeScript made as a superset of JavaScript  
---
### Answer by username_3 on 2023-05-18. Score: 2
# Because there is no other "good" choice

Some languages are made because there is no other “good” (from the viewpoint of the author) languages to be used. For example, I really like embedded scripting, but Lua is a bit… meh to me. For that reason, I’m currently implementing a much more solid language that transpiles to Lua. That way, I can use the features of the languages I love with the popularity of the Lua scripting platform.
---
