Douglas Wells - 2017-11-27

I enjoy investigating new/old languages, and have adopted a set of
successively more difficult commands to develop in such a languages.
This includes hello-world, a POSIX-like echo, a POSIX_like cat, etc.
I'm up to the point of writing a network program to fetch the time
from a remote system. That now works, but the compilation process is
annoying.

Since your XPL package doesn't include such network functions, my
method is to use forward declarations, but never to actually define them
as XPL procedures. Because your XPL compiler translates to C, this
allows me to get at the system functions. For example,
declare socket label;
...
fd = socket ( ...);

The problem is that the compiler (reasonably) complains above the lack
of such a definition, using several screen lines to complain. This
obscures any "real" problems that the compiler might have diagnosed.
The "-W" compiler option is close, but I really do want to see
warnings about undeclared variables.

Do you have any suggestions about a better method? What do you use?

Perhaps you might consider an XPL extension of something like:
<type> ::= label external
<type> ::= label external <string constant="">
where the "external" would signal the compiler that the procedure was
external, and the <string constant" would specify the external name of
the procedure to be invoked (Ada, Fortran, FreePascal ... all behave
something like this).

And again, thanks for releasing your XPL compiler.