On 6/04/2021 1:23 am, Charles Mills wrote:
But IMHO none easy to learn or use.
I am generally not a fan of meta languages at all. I think writing programs is
hard enough, without having to write two effective programs: one that runs at
compile time and one that runs at run time.
In my C++, which is now my primary language, I eschew the use of C macros as
much as reasonably possible. Reasonableness is a key here. For a few things,
macros make sense.
That's interesting. You don't use templates which are one the most
powerful features of C++?
One example. I have a lot of bi-modal code: it runs "production" on z/OS and "limited unit
test" on Windows. Rather than wrap block after block with #ifdef WIN32 or #ifdef __MVS__, I do that
once, in a "universal" header file
#ifdef WIN32
static const bool IsZOS = false;
#else
static const bool IsZOS = true;
#endif
Then anywhere in the code I can write
if (IsZOS) {z/OS specific code}
else {Windows specific code}
I think it's a lot easier to read, and there is no runtime performance penalty.
The z/OS optimizing compiler is smart enough to totally eliminate conditionals
based on a constant.
Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf
Of Farley, Peter x23353
Sent: Monday, April 5, 2021 9:31 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Meta languages [was: RE: Assembler Language Programming for IBM System
z Servers]
True. There is m4 in *ix systems and going back a long time there was ML/1 (I
think there was an academic book published on that one, I think I have a copy
somewhere around here). Undoubtedly others I do not know of or remember.
Probably also Wirth's "literate programming" suite, TeX I think it is called.
But IMHO none easy to learn or use.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN