Sujet : Re: Running an editor from ANSI C
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 08. Jun 2024, 01:32:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240607171237.6@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-06-07, Malcolm McLean <
malcolm.arthur.mclean@gmail.com> wrote:
On 07/06/2024 15:48, David Brown wrote:
On 07/06/2024 12:46, Lawrence D'Oliveiro wrote:
On Fri, 7 Jun 2024 11:31:01 +0200, David Brown wrote:
>
But many people have lots of use of programming in C without any kind of
POSIX functionality ...
>
And all those same programs work in the presence of POSIX functionality,
plus you get access to a whole lot more besides.
No, they do not.
And even if POSIX functionality were "present", whatever you mean by
that, it would be of no help to many C programs.
>
The fact that cases keep arising where POSIX functionality would solve
problems that are discussed in this group belies your point.
There's no doubt that for some C programming, there are POSIX functions
that could help. And no doubt that this is the case for Malcolm's project.
That does not in any way demonstrate that POSIX is required for all C
programming, or that C is "essentially crippled" if POSIX is not available.
Any idiot can write a shell using Posix.
>
The whole point is to it in pure C. Without a single call to a function
that isn't in the C standard library.
A shell written using nothing but the standard library ends up being
a shell to that library: a user interface making available the services
of the library to the user.
When you think about what those are, they are not much.
Your shell won't be able to juggle multiple processes between the
foreground and background, or arrange pipes or anything of the sort.
Remember, the system() function is an API to a command interpreter.
A strictly conforming ISO C programm cannot rely on it.
The command syntax is not specified, and command execution is
required to work at all. If system(NULL) returns zero, it means
that a command interpreter is not available.
Relying another command interpreter while purporting to be writing one
is a kind of fraud, too.
And make it fully functional. A real shell, that people will want to
really use. That's my hobby project. I'm a free man now. I've got the
time. I don't have to write code that makes money any more.
When I mentally survey what is possible in a purely ANSI C shell,
what it will enable the user to do as a shell, I can't imagine why
anyone would want to use it.
I mean, of course, it could contain, say, a fairly engaging and deep
text adventure game. Or a complex and capable programming language (with
poor system access, but interesting nevertheless).
Bug I take it that by shell you mean something which is primarily a
command interpreter for driving an operating system, not an adventure
game engine, or sophsticated programming language run-time.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca