the PROGRAM line
Jose E. Marchesi
jemarch@gnu.org
Wed Mar 26 15:46:42 GMT 2025
> In case of the PROGRAM bold tag the solution may be easy. Either make
> it optional or add a compilation flag to choose the style.
I am pushing a patch that simply removes it. It simply doesn't add any
value and better to do it sooner than later.
>> Note however that there is another way GNU Algol 68 diverges from the
>> Report: the enclosed clause conforming the particular-program yields an
>> integer rather than VOID, which is the exit status reported to the OS
>> upon program termination. Ideas on how to best avoid this divergence
>> are welcome.
>
> To make the situation worse. Unix (or POSIX) is not all. Plan 9 programs
> don't return an integer, but a string as error indication.
> Therefore, main is defined as
>
> void main(int argc, char *argv[])
>
> and the error string is returned via exits(err) . This, and possible
> other differences in OS, may be best handled in a particular-postlude,
> which may be added using a compiler command line switch.
We could have an OS independent proceduresto set the error status
(basically a boolean, success vs. failure) and then revert the
particular-program to be a VOID-unit, letting the OS-specific
particular-postlude do the right thing to communicate the exit status to
the OS.
> Newer plan9 programs use the threaded variant
>
> void threadmain(int argc, char **argv)
>
> Wether the syntax of RR10.1.1d (user-task-list) is helpful for
> threaded programs, is not clear, as the threads are normally created
> after the examination of the command line.
>
> The historic implementations of Algol68 did not support parallel-clauses
> AFAIK.
>
> Perhaps the handling of command line arguments should be considered
> as part of a particular-prelude instead the particular-program.
> In this respect Algol68 has an advantage over solutions derived from C,
> as the particular-program is not restricted to a C single level function.
>
> OTOH, given the strong vitality of the C programming model, RR10.1.1
> may be ignored altogether as pure history, and be replaced by a
> adjourned model.
More information about the Algol68
mailing list