Acceptance Factors
I'd say a combination of various things, but I don't think they are all required. Some languages considered mature nowadays clearly do not satisfy some of these.
I'd say a combination of:
- Tooling:
- mainline: At least one stable "official" or widely-accepted (de-facto or vendor-recommended/supported) tool suite (compiler, interpreter, vm, editor).
- alternative: Some stable and not-so-stable alternatives of the above tooling (closed or open source variants, free or commercial variants, extensions, etc...).
- Community: An active , but not necessarily large group of followers and contributors.
- Recognition:
- Some degree of recognition and use by some industrial actors (even if in a niche).
- Some degree of recognition in popular culture (even if in a niche).
On Fame, Recognition and Maturity
Note that the differentiator here is on having strong and active criteria validators, not large or numerous ones. To clarify, consider these vastly different examples:
Ruby was for a long-time a language with a large community-backing, an official reference implementation and so forth but could hardly be considered mature until it ironed out some of its rough edges. It was famous before being mature.
On the other hand of the spectrum, some once very-widely used languages (COBOL, FORTRAN...) are now less visible but are still mature in every possible sense. They were once famous and mature.
Also, some niche-languages are in my view definitely mature, inspite of their small (but established) market penetration. Consider Oberon or Limbo. They are mature but never got famous. Others, like R, are relatively famous in that their "niches" aren't really niches (bugs me when people call things like Scala or Clojure "niche languages", which they definitely aren't), though their field of applications are not exactly what you'd call mainstream.
On Stability
What's stable anyways? It's quite relative...
- Compliance?
- To the standard (if there's one)?
- To a reference implementation (if there's one)?
- Number of bugs? (hardly a good measure)
- Use in critical environments?
In general, stability simply means I don't get surprised on a daily basis when going about my average job using the language's toolkit, and I can get definitive answers on what should or should not happen when I attempt to do something with the language and its toolkit, whether it's at the build-time or runtime of my programs.
But stability for someone writing smartphone apps and stability for someone writing medical or avionics systems is a different kind of bird.
In my experience, there are three ways to prevent the problems you described above:
- Limit the scope of your variables
- Name your variables something meaningful and descriptive
- Use a pre-compiler to notify of any errors (Doval mentioned pylint for Python)
1) Limiting the scope of your variables will limit the first error. You will have fewer variables that have the possibility of containing the same name. Odds are that you won't have any collisions. You can limit scope by declaring variables only in the scope that they will be used. The reason this works is because variables will be disposed of as a result of the natural cycle in your code. I've provided an example below for clarify.
class:
classVariable = "classVar";
function ThisIsAFunction(functionVar) {
var functionVar2 = "functionVar2";
if functionVar > functionVar2 :
var ifStatementVar = "ifStatementVar";
for i in range(0,2):
ifStatementVar += i;
// i will go out of scope here
// ifStatementVar will go out of scope here
// functionVar and functionVar2 will go out of scope here
2) Naming your variables something meaningful will go a long way to preventing re-use of the same variable name. The key in naming your variables is to make them specific enough that their name cannot be reused. When refactoring code it is a good idea to look for function, variable and class names that can be renamed to better reflect their purpose and meaning. An example of good variable names is the following:
function GetSumOfTwoIntegers(intFirstNum, intSecondNum):
return intFirstNum + intSecondNum;
There is a lot of discrepency when deciding on good names. Everyone has their own style. The main thing to ensure is that you it is clear to yourself and others what the method, parameter or class is supposed to do and be used for. GetSumOfTwoIntegers as a method name tells anyone calling this method that they need to pass in two integers and they will be receiving the sum as a result.
3) Finally, you can use a pre-compiler to tell you of any mistakes that have been made. If you are using a good IDE, it will notify you of any errors. Visual Studio uses Intellisence to let the developer know of any errors before compiling. Most languages have an IDE that supports this functionality. Using one would certainly solve your second problem.
The reason someone might choose to create the syntax of a language in a specific way is hard to determine. I can posture that in Python's case it was likely that the creator wanted to type less when writing code. It only takes a print statement to create a Hello World program in Python. Creating a comparable program in Java requires a lot more typing. Anyways, I don't really know why the creator chose this syntax.
Best Answer
It certainly is relevant for a person to write their own language for educational purposes. To learn about programming language design and about compiler design. But real-world uses are few and far between.
In writing your own language you are:
So, if you plan to write your own language for your project then the features that it provides that other languages don't have need to offset the above costs.
Take games development for example. They often need mini-languages within their games or scripting languages. They use these languages to script out a huge amount of the in-game events that happen. However, even in this case, they almost always choose existing scripting languages and tailor them to their needs.