Liste des Groupes | Revenir à cl c |
On 2024-06-07, Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:It calls system so that real users can use it for real.On 07/06/2024 15:48, David Brown wrote:A shell written using nothing but the standard library ends up beingOn 07/06/2024 12:46, Lawrence D'Oliveiro wrote:Any idiot can write a shell using Posix.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.
>
>
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 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 toWhen I mentally survey what is possible in a purely ANSI C shell,
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.
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.
Les messages affichés proviennent d'usenet.