To be clear.
I am not suggesting that Compilers like GCC be modified to act on the "#!", or
even fully support it.
Just that they be simply modified to ignore "#!" - on the first line (which should terminate with
either a "/r" or "/n").
This allows the easy creation of scripts to handle an executable Source file.
Maybe ignore all lines beginning with "#!" - as this would make it easy to add
a line with extra arguments for a script or program that runs the source file. The
compiler itself doesn't need to have any special features to do that.
I realize that C is not a line oriented language and usually completely ignores
line termination characters (so yes this is probably not a simple thing to do).
The point is to make it easier to use C and C++ (and Fortran, etc) to write
small little utility programs.
This will also make it much easier to teach these languages - and for students
(or anyone) to practice ideas.
Compilation of small source files is so fast these days, that an interpreter
probably is a sub-optimal solution.
Compile, then run helps find errors before the program does anything (One
example of this is perl - which compiles the perl code, then runs it). We
don't need to get into the details of how this would be used - or what the
program that gets started by running the source needs to be able to do.
On 2024-12-28 5:48 AM, Basile Starynkevitch wrote:
Hello all,
Paul Markfort suggested
......
--
--------------------------------------------------------
The views and opinions expressed above are strictly
those of the author(s). The content of this message has
not been reviewed nor approved by any entity whatsoever.
--------------------------------------------------------
Paul FM Info: http://paulfm.com/~paulfm/
--------------------------------------------------------