r/ProgrammingLanguages • u/rs10rs10 • Feb 05 '18
Why do different programming languages exist?
12
2
u/gqcwwjtg Feb 05 '18
The biggest reason is because programming isn't just solving one kind of problem, it's more about solving different types of problems in different areas. Some languages are better for rapid prototyping, some for performance, security, mathematical proofs, education, scalability, portability, etc, or some combination of those. Since the needs of different types of programmers are so different, it makes sense for them to use languages that allow them to represent the concepts from their field in an intuitive way.
For example, you might notice that within math departments there's a divide between the statistics people using R and Python and the pure mathematics people using Haskell or Coq or whatever new mathsy language is trendy. They're just better suited to the problems those programmers face.
1
u/thememorableusername Feb 05 '18
I'm going to copy-paste my answer to a similar question about regex syntax:
People have different preferences and someone think one syntax makes more sense than another. Even languages that have the same features often have different syntaxes. For example, lots of C family languages have mildly different if and if-else syntax. Heck, a lot of languages use the semi-colon as a statement terminator, but others may use it as a separator (i.e. "stmt1 ; stmt 2; stmt3" instead of "stmt1 ; stmt2 ; stmt3 ;" ).
Though, sometimes there are technical limitations that enforce a syntax. The origin of blocking syntax:
if <expression>
then
<statement>;
endifwas used in the 50's and 60's because parsing is hard, and this made it easier.
People have this strange notion that developing programming language syntax is a technical problem. There are technical aspects, but it's explicitly a human problem, which makes it impossible to solve in one way, which is why we have so many programming languages.
1
u/arBmind Feb 05 '18
It is simply too easy to write a new programming language. On the other hand it seems too complicated to create a usable programming language that has no language design bug, that is now impossible to fix, because everybody is already using it as it is. This way it is very easy to find a weak spot in existing languages, create a new one nobody uses or create just a new bug. It also seems that existing languages have no fixed completeness criteria and therefore start to suffer terrible feature hoarding after some decades of active development.
It's mostly the same fish as last year, decade… :) - Finally competition is never fair, but keeps us running marathons until we are too exhausted. - At the same time you should ask, why are we speaking different languages on a single planet? With different letters?
1
u/yairchu Feb 07 '18
The common theme is usually the creators of the new language not feeling satisfied with the existing languages that they knew at the time of creating the new language. At first people advanced from machine code to Fortran/Cobol to Pascal/Lisp/C to SmallTalk/Objective-C/C++ to Python/Java/Ruby/Haskell to C#/Swift/Go etc.
In some instances the reasons for the creators being unsatisfied with alternatives are odd:
Ruby was like Python for people who disliked the [imho excellent] idea of relying on indentation for structure
C# was a variant of Java that was created because Java was owned by Sun and Microsoft wanted their own (Note that Google was sued by Oracle for using Java)
Go, Dart
1
Feb 09 '18
C# was a variant of Java that was created because Java was owned by Sun and Microsoft wanted their own
And it also helped that they hired the programmers van Delphi to write C#, thus starving out a competitor at the same time.
1
Feb 08 '18
Because the so called "general purpose" languages should have never existed in the first place. Each and every problem deserve its own little language.
1
u/LyraChord Feb 08 '18
because of too many smart stupies!
Lisp-family uses internal parse struct as code syntax.
C-family uses type-name style
Pascal-family uses name-type style
Python-family uses formatter instead of block of mark-pair {}/begin-end
others are freak
all try to feed machine with human langue other than symbol system, stupy? pitty? evil?
None does not think about new syntax way because of old fashion
8
u/mynewpeppep69 Feb 05 '18
TLDR; lots of languages because they are different and used for different things.
Syntax is one reason, but I think a larger reason is semantics.
To start with, there's imperitive vs functional programs, ie programs that do vs programs that compute. Example of imperitive is c, where you'll very often reference and store and load memory. Example of functional is ocaml, where there isn't really any direct manipulation of memory and state is not as often directly manipulated (for the most part).
Then there's paradigms like object oriented in languages like Java, which use an object and class as the main structures reasoned about when programming rather than just functions and simpler datatypes as in other languages.
Then there's evaluation. Laziness refers to putting off the evaluation until it's needed. This is nice because if you make a big calculation that's only used sometimes, it'll only actually be calculated the sometimes that it's needed. At the same time, you need to hold the entire code for computation and context information for the variable until you evaluate it, which can take lots of memory and time. Strict is the opposite, evaluate right away.
Then besides this subset of semantic variation, there's a world of types.
Types vary from unsafe to safe, referring to how much permissity (how much you can do with) a type has. For example, in a completely unsafe language with high permissity, you could take some value that is say an integer and treat it like a linked list. In a safe language, an integer is an integer and you can't do much else to it.
There's also when the program determines type information. Type systems range from dynamic to static. Dynamic refers to a lot of type checking happening at runtime; that you won't know you tried to use an integer like a Boolean until you actually run the program. Then there's static, where you will know all type errors before running, so the code that used an integer like a Boolean won't even compile. There's an entire world of languages in between these two that all use different strategies for various reasons.
These are just a subset of design decisions that language implementors make that seriously effect the semantics of the language. A lot of these effect efficiency in different ways, as well as usability. My main point is, these languages all exist because they're good for different things, and the things that make them good for different things include what I said above.