Initially the NPL syntax was designed to be used by non-programmers. So many programming paradigms have not been taken into account. More than 30 years later, this is still the case althoug NPL is used by programmers only. The features have been extended and the syntax has been extended too. Language design errors have been made and never be corrected to be downward compatible. These errors lead to more complex and less understandable restrictions in the language. Some examples are:
- Indexes to arrays can’t be qualified by their level 1 name (ARR(LEVEL1.INDEX)) as this syntax is reserved for referencing.
- You can’t use expressions where you can use a variable (due to ambiguity?).
- "Filler words" and "options" are not recognizable in some statements and can lead to misunderstandings to the reader. What is the difference between
FOR I 1 10 -1 FOR I 1 (10 -1) FOR I = 1 TO 10 STEP -1 FOR I = 1 TO (10 -1)
- What is a single statement and what is many statments? What is the difference between
PRINT A B C FUNC(<>) PRINT A B C; FUNC(<>) PRINT A B C D=FUNC(<>) PRINT A B C; D=FUNC(<>)
- There is a bunch of kewords of normal english meaning, e.g. NAME. If you define a variable NAME on level 1, I can accept the ambiguity with the keyword. But if you define it on a higher level, the ambiguity is no longer given, as you can qualify the NAME by its level 1 name.
This list can be extended to many, many examples.
So, to modernize the syntax, Software AG, remove all ambiguity from NPL. To be backward compatible, a new option canbe added to the source text:
NB: Of course you can name the option as you like
If this option is set as the first statement, you can use syntax from the modernized NPL. The syntax could state:
- Each statement is terminated by a semicolon (see ambiquity in the PRINT examples above)
- Filler words have either to be removed or to be made mandatory (e.g. "=", "TO", "STEP" in a "FOR" statement)
- Where you can use a variable (not receiving) you can use an (complex) expression, function, system function etc.
- You can define a variable not only in a DEFINE DATA but everywhere you like. The scope of the variable is restricted to the context (e.g. if you define a variable in an IF … THEN, the scope is restricted to the statements in the THEN-clause)
- all references to variables must be qualified by their level 1 name .
and much more.
@Software AG: you can name the new language NPL2050. This would manifest your current Natural 2050 agenda!