I'm very interested in this dialect because I'm tired of the language's archaic syntax. ...<cut>... Admittedly, I want to stick to the very basics of the language syntax and data types... <cut>
This is a contradiction. Or the syntax of a particular language is archaic -> so I don't want to use it. Or: I want to use it -> therefore the syntax is clearly not archaic.
It’s not a contradiction, because it has nothing to do with whether I want to use a particular syntax or not. The fact that I prefer to stick to basic syntax and data types (e.g., no OOP, tuples, pattern matching) doesn’t mean that this basic syntax suits me. And it doesn’t suit me, for example, when it comes to unions, bit fields, arrays, etc.—these are basic data types whose syntax is overly complicated.
Besides, how can you recognize archaic or (its opposite) modern syntax? Because it is different from other languages?
Mainly because it hasn't changed in decades, it's clunky and deviates from the norm. If a particular syntax can be improved, it should be improved, and I'm glad that work is underway on these aspects (at least some of them).
When declaring arrays, you specify a number in square brackets, and when specifying the element index, you also specify a number in square brackets. This is error-prone.
Why exactly would that be error-prone? An array declaration is a separate and unambiguous context, so it’s impossible to confuse specifying the number of array elements with accessing a specific element. It is not without reason that other languages have a syntax completely different from Pascal’s, because it is simpler, shorter, and still unambiguous.
When I declare an array, I do so for a specific number of elements, and I almost always use zero-based indexing. And since the indexing is the same in 99.9% cases, requiring the index range to be specified in 99.9% of declared arrays is a waste of time and unnecessarily lengthens the code.
Secondly, the idea of "tinkering" with the counter of a "for" loop within that loop is absurd. These two ideas should not be implemented under any circumstances, as they will cause various problems in the future.
It is absurd to prohibit the use of the alter iterator in
for loops and force users to use other loops. Not only does this fail to prevent incorrect implementations (since exactly the same problems exist with
while or
repeat loops), but it also forces a longer implementation and annoys the user by treating them like an underdeveloped child.
A programming language is a tool that is meant to serve the user. Programming isn’t kindergarten—either you know how to program or you don’t, and if you don’t, the language’s features don’t matter, because you won’t be able to use them correctly anyway, regardless of what’s allowed and what isn’t. If you can't implement the algorithm using a
for with altering its iterator, you won't be able to implement it using a
while loop either.
This idea is redundant, error-prone, and difficult to read compared to the current one.
Absolutely not, and that is precisely why most modern programming languages use exactly this syntax, whereas the one found in Pascal is redundant and rarely found anywhere. In contrast, the Pascal syntax is error-prone because it requires specifying the upper index, which makes it much easier to make a mistake by forgetting the
-1 for 0-based indexing.
A typical C-ism.
No, it's just a simplification of what is redundant. In contrary, yours is a typical case of C-phobia (or even modern-phobia as such syntax is commonly used in nearly all modern programming languages).
Another terrible idea. Especially the one with two or three variables in the loop header. If someone thinks they need this language construct, they should probably rethink their code, because something is flawed.
What are you talking about? You write as if you've never written a loop in your life where the iterator needs to be modified dynamically and on which the final number of iterations depends. Of course such algorithms exist (and I even gave an example of one I recently implemented), and of course it would be easier and simpler to implement it using a
for loop rather than a
while loop.
And the funniest part is that you can easily implement loops in C or C++ this way, dynamically modifying not only the
for loop iterator but also its termination condition. This gives you full control over how the loop behaves and reduces the amount of code you need to write, and this is exactly what my proposal is about. But C/C++ is a tool that supports the programmer, while Pascal is an overprotective mom, unjustifiably forbidding her child from doing this and that so the poor thing doesn’t hurt itself.
