473,573 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UNIX, C, Perl

Given that UNIX, including networking, is almost entirely coded in C,
how come so many things are almost impossible in ordinary C? Examples:
Network and internet access, access to UNIX interprocess controls and
communication, locale determination, EBCDIC/ASCII discrimination, etc.

Almost all of these are easy in Perl. Why isn't there a mechanism like
perl modules to allow easy extentions for facilities like these? Isn't
anyone working on this problem? or is it all being left for proprietary
systems?
Sep 2 '08
223 7157
jacob navia said:
Ben Bacarisse wrote:
<snip>
>Because
there is no agreed way to program a flexible array, a list or a map,
everyone writes their own, or uses a published one that is
incompatible with all the other published ones out there. It is often
a lot of work just to coax two libraries to work together.

That is why I have been insisting that we adopt the operator overloading
feature that would allow using the '[' and ']' notation for general
containers.
I don't think you're in a position to insist, are you? Not even Microsoft
is in a position to insist on a change to the C language. In fact, not
even Dennis Ritchie is in that position.

It is sometimes difficult to remember that what one person sees as an
obvious improvement, another person sees as a hideous wart. Putting
oneself in another person's position is a useful and informative
intellectual exercise. Think up a change to C that you would really NOT
like to see in the language, and you should get the idea.

By the way, I'm not particularly against the idea of introducing operator
overloading into C (although many people probably are). But politicking
about it in comp.lang.c isn't going to get you anywhere. It's the ISO
people, not us, that you have to convince, and they are going to take a
lot of convincing after the drubbing they took over C99.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 3 '08 #41
Richard Heathfield wrote:
jacob navia said:
>Ben Bacarisse wrote:

<snip>
>>Because
there is no agreed way to program a flexible array, a list or a map,
everyone writes their own, or uses a published one that is
incompatibl e with all the other published ones out there. It is often
a lot of work just to coax two libraries to work together.
That is why I have been insisting that we adopt the operator overloading
feature that would allow using the '[' and ']' notation for general
containers.

I don't think you're in a position to insist, are you? Not even Microsoft
is in a position to insist on a change to the C language. In fact, not
even Dennis Ritchie is in that position.
I know your position. Let's do nothing, and leave C to die a
peaceful death.

Any language that refuses to change anything and still tries
to see the world as we were in the times of the PDP 11 will
die, and C is going into that direction.

There is NO other solution that to introduce a way to share
libraries using lists/ flexible arrays, what have you in
a simple at the same time general way!

If we use the '[' and ']' notation for that, C libraries can
implement any container they like behind the scenes, the
user of those libraries writes

data[2]

and that is all there is to it!

The library has defined data as a flexible array, a list,
or a simple array and that will work with user code unchanged.
It is sometimes difficult to remember that what one person sees as an
obvious improvement, another person sees as a hideous wart. Putting
oneself in another person's position is a useful and informative
intellectual exercise. Think up a change to C that you would really NOT
like to see in the language, and you should get the idea.
How would *you* solve the above problem?

Obviously you just do NOT want to solve it, and leave the problem
untouched. That way, C libraries can't share any general containers,
and newcomers are put off by needing to code a linked list for the
thousandth time.

By the way, I'm not particularly against the idea of introducing operator
overloading into C (although many people probably are).
Until now you have always attacked me because I dared not only to
say

"I am not against it"

but proposed a concrete implementation to do exactly that.

But politicking
about it in comp.lang.c isn't going to get you anywhere.
I am trying to convince people that what I am proposing is a better
alternative. Why should I stay away from a discussion here?

It's the ISO
people, not us, that you have to convince, and they are going to take a
lot of convincing after the drubbing they took over C99.
They will never do anything since their main objective is to preserve
C as a language that should run legacy code with no new development,
as Mr Gwyn explained in comp.std.c. Any time I have proposed there
to change anything like even get rid of a buffer overflow in asctime()
the negative reaction of those people was almost unanimous.

For instance I proposed to get rid of trigraphs. Just read that
discussion.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 3 '08 #42
jacob navia <ja***@nospam.c omwrites:
Richard Heathfield wrote:
>jacob navia said:
>>Ben Bacarisse wrote:
<snip>
>>>Because
there is no agreed way to program a flexible array, a list or a map,
everyone writes their own, or uses a published one that is
incompatib le with all the other published ones out there. It is often
a lot of work just to coax two libraries to work together.
That is why I have been insisting that we adopt the operator overloading
feature that would allow using the '[' and ']' notation for general
containers.
I don't think you're in a position to insist, are you? Not even
Microsoft is in a position to insist on a change to the C
language. In fact, not even Dennis Ritchie is in that position.

I know your position. Let's do nothing, and leave C to die a
peaceful death.
Your gross misrepresentati ons of other people's opinions are really
getting old. It's possible to disagree with people without being
hostile, but you don't seem to have the knack.

To be clear, your silly parody, "Let's do nothing, and leave C to die
a peaceful death", does not resemble anything Richard has ever written
as far as I know.

[...]
They will never do anything since their main objective is to preserve
C as a language that should run legacy code with no new development,
as Mr Gwyn explained in comp.std.c.
I don't recall Doug Gwyn ever saying that, and I'm certainly not going
to take your word for it. Please post the Message-ID of an article in
which he said that.
Any time I have proposed there
to change anything like even get rid of a buffer overflow in asctime()
the negative reaction of those people was almost unanimous.
In that discussion, there were several concrete proposals to change
the specification of asctime.

Most of the negative reactions were in response to your stubborn
refusal to acknowledge that your proposal would change the behavior of
asctime in circumstances where that behavior is now unambiguously (but
strangely) defined. I said, several time, that I'd be willing to
accept your proposal *if* that fact were acknowledged (not that I have
any say in the matter), but you wouldn't compromise even that much.

And for the Nth time, the problem with asctime isn't that it's
possible to trigger a buffer overflow by using it incorrectly, it's
that the conditions under which that buffer overflow is triggered are
not stated clearly enough. strcpy can trigger a buffer overflow just
as easily as asctime can.
For instance I proposed to get rid of trigraphs. Just read that
discussion.
I did read it. Concrete examples were presented of systems on which
trigraphs are still in use. And it was pointed out that the problems
that can be caused by accidental trigraphs are rare, and can be
addressed by issuing warnings when their use might be accidental.

I wouldn't oppose dropping trigraphs from the language, but again,
such a change would alter the behavior of some programs whose behavior
is now unambiguously defined. And if a new C2008 standard were issued
tomorrow, identical to C99 but with trigraphs eliminated, programmers
would still have to deal with the possibility that their code might be
used with older compilers that still support trigraphs.

As long as you refuse to acknowledge the importance of backward
compatibility, even in cases that *you* think are unimportant, it will
be difficult to take your proposals seriously.

If I had as many smart people disagreeing with me as you do, I'd start
to consider very seriously the possibility that I might be wrong.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 3 '08 #43
Ben Bacarisse wrote, On 03/09/08 17:31:

<snip>
But there *is* an important issue here. Perl's modules work well
together because of the dynamic type system, and the fact that Perl
has very flexible containers. Using C, you may be able to find a
great XML parsing library (for example) but it will probably represent
its lists and tables using different types (and access functions) to
all the other libraries you need. This is why Perl is so good at
"gluing" tasks.
Hmm. I had no major problems stitching together an XML processing
library (and the xslt and xmlsec libraries built on top of it) and
libraries for communicating over the internet in various forms, and
custom in-house libraries that still use their own customer data
structures. All of this in C (plus networking extensions obviously). You
just have to pick the right libraries.
This is the elephant in the room as far as C is concerned. Because
there is no agreed way to program a flexible array, a list or a map,
everyone writes their own, or uses a published one that is
incompatible with all the other published ones out there. It is often
a lot of work just to coax two libraries to work together.
Sometimes it is, sometimes it is hard. Sometimes stitching things
together in Perl is a right pain.
--
Flash Gordon
Sep 3 '08 #44
jacob navia said:
Richard Heathfield wrote:
>jacob navia said:
>>Ben Bacarisse wrote:

<snip>
>>>Because
there is no agreed way to program a flexible array, a list or a map,
everyone writes their own, or uses a published one that is
incompatib le with all the other published ones out there. It is often
a lot of work just to coax two libraries to work together.
That is why I have been insisting that we adopt the operator
overloading feature that would allow using the '[' and ']' notation for
general containers.

I don't think you're in a position to insist, are you? Not even
Microsoft is in a position to insist on a change to the C language. In
fact, not even Dennis Ritchie is in that position.

I know your position. Let's do nothing, and leave C to die a
peaceful death.
Well, no, that isn't my position. But it seems you have misunderstood the
point I was making, and I have no particular desire to explain the
blindingly obvious twice over.

<snip>
>By the way, I'm not particularly against the idea of introducing
operator overloading into C (although many people probably are).

Until now you have always attacked me because I dared not only to
say

"I am not against it"

but proposed a concrete implementation to do exactly that.
No, I would not be so foolish as to attack you for daring to propose a
change to the C language. I'm just curious as to why you propose it here,
since nobody here has any authority to change the language definition
(except Larry, perhaps, since he's actually a voting member of the ISO C
Committee). It seems rather pointless.
>But politicking
about it in comp.lang.c isn't going to get you anywhere.

I am trying to convince people that what I am proposing is a better
alternative.
Fine. Why not go convince the ducks in St James's Park? (Serious question,
and if you answer it seriously, the answer will reveal a serious point.)
Why should I stay away from a discussion here?
Why should you stay away from a discussion with the ducks in St James's
Park?
>It's the ISO
people, not us, that you have to convince, and they are going to take a
lot of convincing after the drubbing they took over C99.

They will never do anything
If you think so, then you're sunk, because they're the only ones who /can/
do anything.
since their main objective is to preserve
C as a language that should run legacy code with no new development,
So you claim.
as Mr Gwyn explained in comp.std.c.
Cite, please. You're so completely useless at understanding what people say
that I want to see some evidence before I'll even think about believing
that claim.
Any time I have proposed there
to change anything like even get rid of a buffer overflow in asctime()
the negative reaction of those people was almost unanimous.
I can think of several reasons for that, none of which does you any credit,
so I'll keep them to myself.
For instance I proposed to get rid of trigraphs.
....and just abandon platforms with limited character sets. Nice one.
Just read that discussion.
What's the point? It'll just be same ol' same ol'. I've read your
"discussion s" before, the ones where you call people idiots and liars for
daring to have a viewpoint different from yours. No, thanks.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 3 '08 #45
Richard Heathfield wrote:

[snip]

I asked you a question Heathfield, a question that you conveniently
snipped away.

I repeat it:
How would *you* solve the above problem?

How would you make different libraries interoperate with lists,
flexible arrays, arrays, double linked lists, etc?

If I use a networking library I get a list of servers
from a dns request. I need the list package of the
net library.

If I use in the same program a file handling library I get
a list of files from a request like
"*.c"

Both lists packages will be redundant code and name clashes are
highly probable

How would *you* solve this problem?

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 3 '08 #46
Keith Thompson wrote:
jacob navia <ja***@nospam.c omwrites:

[...]
>They will never do anything since their main objective is to preserve
C as a language that should run legacy code with no new development,
as Mr Gwyn explained in comp.std.c.

I don't recall Doug Gwyn ever saying that, and I'm certainly not going
to take your word for it. Please post the Message-ID of an article in
which he said that.
The 26 september 1997, Dennis Yelle had the idea of asking in comp.std.c:

Can we get rid of gets()?

Mr Gwyn defended keeping gets() in the standard document.

And he won. gets() is still in the C99 document.

I started a similar discussion last year, 11 years later and Mr Gwyn
was again in the group of the ultra-conservatives that want to keep
gets(), trigraphs, and vehemently deny that ANY changes should
be done.

He repeated the same position in 2004, when I started again a discussion
about gets().

And in 2007 he repeated his position. No changes, gets belong to the
language.

The same for ALL the proposals to change a minimal part of the
language. Not even blatant errors like trigraphs.


--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 3 '08 #47
jacob navia wrote:
Keith Thompson wrote:
>jacob navia <ja***@nospam.c omwrites:

[...]
>>They will never do anything since their main objective is to preserve
C as a language that should run legacy code with no new development,
as Mr Gwyn explained in comp.std.c.

I don't recall Doug Gwyn ever saying that, and I'm certainly not going
to take your word for it. Please post the Message-ID of an article in
which he said that.

The 26 september 1997, Dennis Yelle had the idea of asking in comp.std.c:

Can we get rid of gets()?

Mr Gwyn defended keeping gets() in the standard document.

And he won. gets() is still in the C99 document.

I started a similar discussion last year, 11 years later and Mr Gwyn
was again in the group of the ultra-conservatives that want to keep
gets(), trigraphs, and vehemently deny that ANY changes should
be done.

He repeated the same position in 2004, when I started again a discussion
about gets().

And in 2007 he repeated his position. No changes, gets belong to the
language.

The same for ALL the proposals to change a minimal part of the
language. Not even blatant errors like trigraphs.
The fact that Doug Gwyn opposes one proposed change to C
does not demonstrate that he opposes or would oppose all changes.
The fact that one prime number is even does not demonstrate that
all prime numbers are even.

Even if Doug Gwyn opposed all changes, it would not follow
that he wants "to preserve C as a language that should run legacy
code with no new development." The fact that all prime numbers are
even does not mean that they are all blue.

Also, loaded terms like "ultra-conservatives," "vehemently ,"
and "blatant" do not make your argument stronger, just hotter. Or
to put it differently: Your childish and irresponsible use of loaded
terms like "ultra-conservatives," "vehemently ," and "blatant" do not
make your pathetic excuse for an argument stronger, just hotter,
louder, and even MORE ridiculous than usual.

--
Er*********@sun .com
Sep 3 '08 #48
In article <1220469839.903 758@news1nwk>,
Eric Sosman <Er*********@su n.combloviated:
....
Also, loaded terms like "ultra-conservatives," "vehemently ,"
and "blatant" do not make your argument stronger, just hotter. Or
to put it differently: Your childish and irresponsible use of loaded
terms like "ultra-conservatives," "vehemently ," and "blatant" do not
make your pathetic excuse for an argument stronger, just hotter,
louder, and even MORE ridiculous than usual.
Calm down. Take your medicine. You'll feel better soon.

Sep 3 '08 #49
Kenny McCormack wrote:
Calm down. Take your medicine. You'll feel better soon.
Kenny, you did not answer my post...

You consider C really dead?

I mean your opinion *is* important (at least to me)
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 3 '08 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6535
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix...
2
5658
by: Mohsin | last post by:
Hi all, I have a perl program which makes a user exit to the O/S (unix, solaris) to issue a O/S command. I know that the shell it invokes is NOT a korn shell, because I captured the shell info into a file with a 'ps' command. My question is "How to explicitly specify a Korn shell to be used by perl?" Eg of my perl code: ## Begin code...
0
6437
by: Danny Jensen | last post by:
I need to test if certain processes on a unix box were running. I wanted to use whatsup gold to do the testing. First I needed to go to the whatsup configure>monitors & services menu to add this tcp/ip port 1555 service with the folowing lines: Send=psef /dj/myco/rf.monitor\r\n Expect=~1 the psef above is a command that the unix server...
1
17710
by: Al Belden | last post by:
Hi all, I've been working on a problem that I thought might be of interest: I'm trying to replace some korn shell scripts that search source code files with perl scripts to gain certain features such as: More powerful regular expressions available in perl Ability to print out lines before and after matches (gnu grep supports this but is...
6
1655
by: asimorio | last post by:
Hi folks, Recently, I am investigatin a memory leak issue. I have written a simple C++ program and a Perl script to test on UNIX environment machine. I do a for loop to new up 20 char of size 32768 bytes, then delete them. Please see below: //// part of the code start //// for (i=0; i<20; i++) { ptrA = new (std::nothrow) char;
2
4260
by: perlnewbie | last post by:
Hi everyone I am new to perl and I am writing a perl script to invoke a set of commands on UNIX clearcase vob however I am having trouble after setting the view and mounting the vob I want to change the directory into the vob and then using Cwd or pwd to confirm I am in the vob to continue the CC functions. Sample code in perl : $Result =...
4
3774
by: jane007 | last post by:
Hello everybody: I am having a problem. On Unix platform, there is a script that need user to input data from console, then when I call Unix perl script from Windows, these is an issue occurs, when I input data and enter "enter" so fast, the Windows console is freezed, I don't know why, does anybody know?Thank you very much. My code...
4
4262
by: mdshafi01 | last post by:
Hi , I am trying to send mail from unix perl. I am using following code to send mail. It is not triggering mail and also it is not giving any error. please tell me any special settings are required or this program should be executed from special user with higher permission or something. please tell me.
1
3970
by: dxz | last post by:
I have a perl script to run on both UNIX and Windows. How should I write the Shabang line: On UNIX, it is #!/usr/bin/perl On Windows, it is #!C:\perl\bin\perl.exe Which one should I use? Should I combine them? If yes, how?
0
7747
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7987
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6363
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3706
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2167
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.