Sujet : Re: VMS Pascal article
De : johnrreagan (at) *nospam* earthlink.net (John Reagan)
Groupes : comp.os.vmsDate : 07. Jan 2025, 21:16:22
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <73aedef89896db7fe5bc43b8d47a8560537c6a48@i2pn2.org>
References : 1 2
User-Agent : Mozilla Thunderbird
On 1/6/2025 5:52 PM, John Reagan wrote:
On 1/1/2025 11:12 AM, Arne Vajhøj wrote:
VMS Pascal for C/Java/C# programmers:
https://www.vajhoej.dk/arne/articles/vmspascal.html
>
It is a "pre-release" - I am not sure I got it right.
>
So I would love some feedback.
>
Arne
>
I'll look and give feedback.
John
For modern OpenVMS usage, you might want to discuss how to get 64-bit pointers vs 32-bit pointers. C has the pointer_size pragma to modify the "current pointer size". Pascal uses the [QUAD] attribute in front of the pointer uparrow. There isn't a DCL qualifier (or module-level attribute) to control the default of 32-bits. I'd add one now but who would use it?
var
ptr64 : [quad] ^integer;
ptr32 : ^integer;
The compiler will call the appropriate Pascal RTL routine for NEW or NEW64 based on the pointer's type.
As noted, QUADRUPLE is always 128-bits. With all the hassle with missing support on x86, I should have added the equivalent of /L_DOUBLE for Pascal (and others as well).
Yes, VARYING OF CHAR is a VAX Pascal V2.0 extension based highly on PL/1's VARYING OF CHAR. I've seen comments hinting about an early form of VARYING OF BITS as well but that was never added.
Extended Pascal's STRING type is modeled much on VAX Pascal's VARYING OF CHAR. You can check the Extended Pascal's title page to see who was the X3J9 Secretary at the time. 😉
The VARYING OF CHAR .BODY and .LENGTH are quite powerful especially when you use them with IADDRESS. Along with the VAX Pascal V1 directives of %IMMED, %REF, and %STDESCR (notice the parallel with Fortran?), you can do many descriptor operations with ease.
STRING allows for a run-time length since it is an Extended Pascal "schema" type. VARYING OF CHAR does not. We could have added that feature to VARYING OF CHAR but we didn't.
We only added the Extended Pascal features that we thought were new and interesting. For example, we didn't bother with Extended Pascal's "complex" type. If you want a complex type, you code in Fortran as God intended. We didn't add the EP direct access file syntax since the VAX Pascal syntax provides the same feature set (guess where the feature set came from). We also didn't add the EP module syntax which added namespaces. (The PEN format actually has support for multiple name spaces but the compiler doesn't take advantage of it).
The Pascal SDL backend was ever thought about 64-bit integers and such since we wanted to keep as much recompile-and-go as possible.
Yes, the Pascal examples installed by the kit are a good resource. I haven't updated them in quite a while. Perhaps it is time. Maybe I'll do that when I finish the conversion to PCSI. Any suggestions?
I have a copy of Theo De Klerk's book on my bookshelf. I did the technical review of that book (wow, that is a long time ago!)