Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <v41f0a$2j12l$2@dont-email.me>
Deutsch   English   Français   Italiano  
<v41f0a$2j12l$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Malcolm McLean <malcolm.arthur.mclean@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: Running an editor from ANSI C
Date: Sat, 8 Jun 2024 12:23:54 +0100
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <v41f0a$2j12l$2@dont-email.me>
References: <v3pge7$uf2i$1@dont-email.me> <v3r2pl$16mtl$1@dont-email.me>
 <v3r7v8$1b57j$1@dont-email.me> <v3rek5$1c4i5$1@dont-email.me>
 <v3rrtm$1e6g8$1@dont-email.me> <v3ru84$1eafb$1@dont-email.me>
 <87o78dzw1a.fsf@nosuchdomain.example.com> <v3tkmb$1o860$3@dont-email.me>
 <v3uk0l$20s0s$2@dont-email.me> <v3uoeo$21g4g$5@dont-email.me>
 <v3v6jt$23q0b$2@dont-email.me> <v3vk3m$265uv$1@dont-email.me>
 <20240607171237.6@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 08 Jun 2024 13:23:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8b6752f00a378e9a22da030b3b8d942a";
	logging-data="2720853"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19fcZA0pC6rxvpUXuDI+cCk++BUXuWCLmA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:07YdOrzDn2V6rs20AVsCdrqYcGM=
Content-Language: en-GB
In-Reply-To: <20240607171237.6@kylheku.com>
Bytes: 5476

On 08/06/2024 01:32, Kaz Kylheku wrote:
> 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.
> 
It calls system so that real users can use it for real.

But as you say, that is a cheat. But it's a serious cheat, because what 
the serious users want to do is to edit FileSystem files. So let's say 
we've a picture of Rishi with a dog embedded in a html file on the 
archive, and we want to change the picture to Rishi with a cat. The 
serious user will do that with PhotoShop. So he'll call the shell, 
export the file, run PhotoShop on it, and then reimport it.

He's not going to write a MiniBasic script to take the image in and 
process it, without exporting it from the shell. Technically he will be 
able to achieve that. But that's for the fun users.

So at the moment I'm concentrating on getting the "ls" command just 
right. Currently it just lists out the files in the working directory, 
and it's getting wildcards and sorts and options. And it's not exactly 
implenting a shell, but it's what the serious users will want, and so 
they come first. Then I get the Basic working properly.

-- 
Check out Basic Algorithms and my other books:
https://www.lulu.com/spotlight/bgy1mm