Prof A Olowofoyeku (The African Chief) wrote:
A matter of opinion and perspective. If not for Borland Pascal, I would not be a "Pascal" programmer today. I think that Borland's versions of "Pascal" did much to give the language critical mass outside the classroom. Whether it is really "Pascal" or not is a debate that reminds me of old law school debates about whether "International law" is really "law" - everybody had his opinion, and no-one's opinion ever changed.
That's quite a difference. "Law" is a word from common language and has developed in cultures etc. "Pascal", OTOH, (in this context) is the name that Wirth gave to a language he designed, therefore it's a well defined term, not subject to opinions. (The language was later revised in the standard, but it only made some clarifications and did not really deviate from the original language. The later standard is called "Extended Pascal" -- rightfully, since it's strictly an extension and includes the previous version completely.)
To say it again, I think it's quite impertinent to create a mutilated form of the language and claim that the result is the real language. It's quite unfortunate that in this society, apparently Wirth would have had to get a trademark and sue Borland to prevent such an abuse. But to be fair, I'm not sure if Borland actually made this claim (though many users do, mostly out of ignorance I guess). It may be that Borland only talked about the "Turbo Pascal" and "Borland Pascal" languages or similar, which may be acceptable and could be read as describing a dialect (but still bears the confusion to be understood as the Pascal language by Borland).
[ About the usefulness of `()' ]
So why did the persons who invented the word "compiler" or "computer" or any other new English word bother to do so? And if they never did it, how would we describe today what I am now typing on, or the software that you and Peter work so hard to maintain?
So these words have a meaning, as you describe. I still haven't seen any practical usefulness of the `()' feature. I don't think we have to travel to foreign (Bor-)lands to see the usefulness, if there is any. Apparently, this feature has been supported in Delphi for some time, so there must be some examples what it's good for (except the laziness of former C/C++ programmers to learn and save to keystrokes).
[...]
That would be ok -- that's roughly what GNU does as well: Have a single backend (if I may equate this with engine), have many libraries (sure, not a single one, since there's not this MS-ish uniformity) which can be called from many languages.
But why on earth do they mix the languages together? That's not necessary for this model to work.
If you want to have a single VCL and RAD tool, written in Pascal, and you don't want to reinvent it again and again for your C++ compiler, you have no option but to allow C++ to compile Pascal.
Yes, you have. Simply allow C++ to access Pascal routines (same as most Pascal compilers can call routines written in other languages). There's no need for the C++ compiler to compile the Pascal code.
Waldek Hebisch wrote:
I think the rational reason is overloading: if one wants methods and atributes to share a name, then the syntax must distingush between variables and parameterless functions.
What are attributes? Object fields, or properties?
Anyway, I have a hard time seeing an advantage of function overloading already (i.e., the slight convenience of naming "everything" the same minus the added confusion, especially when debugging), but overloading the same name for routines and variables??? What's next? Overloading types and labels? Or constants and reserved words? Redefine the `[' and `]' "operators"? ;-)
Prof A Olowofoyeku (The African Chief) wrote:
Not very far. Delphi has things like function and method overloading, commenting with "//", and things like "foo()". Delphi has "variants" (compatible with virtually any type), and things like "Array of Const" parameters. But I am not sure whether these were borrowed from C++ or not.
C++ has `//' comments and overloading (that doesn't necessarily mean they were invented there, I don't know that exactly), C/C++ have function calls with `()'. C/C++ has `void *' parameters which are like BP's untyped parameters, but I suppose variants are not quite the same. And C/C++ surely has something like `array of const', but with a more sane syntax -- sure, C's syntax for structured types is a little strange, but once you've understood the rules, it's quite logical in itself; I can't say that of `array of const' -- `array of' is normally followed by a type denoter in Pascal, but here they put the word `const' instead.
I seem to see a pattern in the last two examples. Apparently, a common pattern is to macerate the syntax more and more. Of course, it already started in BP. E.g., the untyped parameters -- we can argue about their usefulness (semantically), but syntactically at least a pseudo-type like `Void' (cf. C) would have been much cleaner than just omitting the type (and creating a new syntax just for that special case). Or the ridiculous "typed constants" (syntactially) instead of initialized variables (which they are semantically). Not to mention `absolute' variables as well as the `Mem' and `Port' arrays (which map features of the processor architecture, the segment/offset addressing and the assembler I/O instructions, into the language syntax). `interrupt' procedures and the BP `asm' syntax(*) (especially for whole routines) are not much better, either. Oh yeah, and the infamous `^A' syntax for character constants ... -- Oh well, was it already that bad in BP -- I almost had forgotten it until I started to collect this list ...
(*) Admitted, GPC also extends the syntax for `asm'. But at least the machine instructions and register names are put into string constants, so it's possible to parse it without knowing the details of the target architecture.
And apparently they're happily continuing this trend. I can't help but think that sooner or later that language will just collapse under its own weight. (OK, what does collapse mean here? Creating inconsistencies and ambiguities in itself? Well, BP has done that long time ago. I guess in such a commercial-proprietary setting it will mean they either go bankrupt or they drop the product because they can't maintain it anymore.)
I sometimes hear the argument that good programmers don't use the whole mess of misfeatures, but only a "sane" subset of the language -- I hope that's true. If it is, maybe we should focus on supporting such a sane subset, and if nobody else does, we might even have to define that subset first. That might imply that we should not support features like `()' and other misfeatures (in contradiction to what I said yesterday) -- not because `()' would be difficult to implement, but because for all I know it has no real use and just adds unnecessary complexity.
One of the features of the original Pascal was a very clean syntax -- unfortunately the language was too limited for many purposes. Extended Pascal went a long way to remedy the latter while keeping the language mostly as clean and systematic. The (draft standard) object extensions (which actually seem close to Delphi's model) seem to follow in this spirit. But for many other extensions, I fail to see big advantages, but I often see substantial disadvantages (often in the syntax).
Frank