473,789 Members | 2,467 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 7380
jacob navia wrote:
) 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?

You're begging the question.
Richard never claimed (in this thread at least) that your
solution was bad in any way.

And here's the question *you* never answered.
The question that *is* relevant:

Why do you argue about changing C *here*, in this newsgroup ?
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
Sep 3 '08 #51
Willem wrote:
jacob navia wrote:
) 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?

You're begging the question.
Richard never claimed (in this thread at least) that your
solution was bad in any way.
He just snipped the question. Obviously if I asked the question
again I wanted to know what he thinks.

I did not say that he answered...
And here's the question *you* never answered.
The question that *is* relevant:

Why do you argue about changing C *here*, in this newsgroup ?
Because this group discusses the C language obviously.

I presented my ideas to the comp.std.c group, many times.

I discuss them there too.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 3 '08 #52

"Ben Bacarisse" <be********@bsb .me.ukwrote in message
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.
I still have some "give me 64" mugs left. I trust you are now joining the
campaign for 64 bit ints.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Sep 3 '08 #53
On Wed, 03 Sep 2008 17:07:00 +0200, jacob navia <ja***@nospam.c om>
wrote:
>Richard Heathfield wrote:
>Pilcrow said:
>>Given that UNIX, including networking, is almost entirely coded in C,
how come so many things are almost impossible in ordinary C?

I don't know of anything computable that isn't computable in ordinary C.
>>Examples:
Network and internet access,

C allows you to call library functions that provide these features, but
doesn't go so far as to make their provision mandatory. (Otherwise, you
couldn't have a C implementation on a system that didn't have internet
access - and that would be silly.)

Exactly.

There are many implementations of networking, from
Windows sockets, BSD sockets, Netware, USB networking,
Wan, LANs, etc.

To make mandatory the usage of some kind of network would
be a foolish. Besides, you can do things in C that are MUCH
more cumbersome in perl. For instance an ftp transfer in Perl
looks like this:
----------------------------------------------perl
#!/usr/bin/perl -w
require('ftpli b.pl');
use strict;
my(@dirList) ;
ftp::debug('ON ');
ftp::open('ftp .cis.ufl.edu', 'anonymous', 'm******@planet .net') or die($!);
@dirList = ftp::list('pub/perl/faq');
ftp::cwd('/pub/perl/faq');
ftp::binary( );
ftp::gets('FAQ .gz');
@dirList = ftp::list();
print("list of /pub/perl/faq\n");
foreach (@dirList) {
print("\t$_\n" );
}
@dirList = ftp::dir();
print("list of /pub/perl/faq\n");
foreach (@dirList) {
print("\t$_\n" );
}
ftp::debug() ;
ftp::cwd('/pub/perl/faq');
@dirList = ftp::list();
print("list of /pub/perl/faq\n");
foreach (@dirList) {
print("\t$_\n" );
}
----------------------------------------------perl
You seem to be using a very old version of perl - perhaps even perl 4.
And no perl user would use that style. The two lines before the last
bracket, for example, would probably be coded like this:

print "\t$_\n" for @dirlist;

See the modules Net::FTP or WWW::Mechanize or LWP::Simple for modern
methods.

>Using lcc-win the above program looks like this:

----------------------------------------------C (lcc-win)
int returncode = GetFtpUrl("ftp://ftp.cis.ufl.edu/pub/perl/faq","faq");
----------------------------------------------C (lcc-win)
You can not have tested that, since there is no such directory at the
site of the University of Florida.

However, here is a one-line perl script I've actually tested:

perl -MLWP::Simple -e 'getstore "http://www.google.com" ,"demo.html" '

You type it on the command line. It retrieves Google's home page and
stores it in the file demo.html .
But you need the module LWP::Simple to run it

(snip)
>Exactly. C has "modules", and the interface is simple and efficient.
There is an enormous amount of C libraries around.
I am so glad to hear that. Perhaps someone would be so kind as to post
a list of them? At least the more important ones. URL's would be nice.


Sep 3 '08 #54
jacob navia <ja***@nospam.c omwrites:
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.
Ok.
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.
Ok.
He repeated the same position in 2004, when I started again a discussion
about gets().
Ok.
And in 2007 he repeated his position. No changes, gets belong to the
language.
Ok.
The same for ALL the proposals to change a minimal part of the
language. Not even blatant errors like trigraphs.
Ok.

Please post the Message-ID of an article in which Doug Gwyn said that
the main objective of the C standard committee is to preserve C as a
language that should run legacy code with no new development.

Given your track record for inferring people's opinions from what they
write, I don't believe that Doug holds or has ever expressed that
opinion or anything like it. More specifically, I'm sure he thinks
that C should continue to be a language that can deal with legacy code
(so do I; do you?); I don't believe for a moment that he thinks there
should be no new develpment in C.

--
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 #55
jacob navia wrote:
Willem wrote:
....
Why do you argue about changing C *here*, in this newsgroup ?

Because this group discusses the C language obviously.

I presented my ideas to the comp.std.c group, many times.

I discuss them there too.
While such a suggestion is on-topic in that group, it is still not the
right place to make your proposal. Only a small number of committee
members participate in that group. If you really want anything to
change, you have to present your proposal to the committee, or at
least convince one of the committee members that your ideas have
sufficient merit to for that committee member to present them for you.
The committee members ore the ONLY ones who can actually make it
happen - nothing you say to anyone else will have much effect.

Further piece of advice: if and when you actually make your proposals
to the committee, please try to lay off on the slanderous accusations
that pepper your typical postings in this newsgroup. Even if those
accusations were true, you couldn't possibly expect accusations of
idiocy, incompetence, and laziness to make the people you so accuse
more willing to cooperate with you, could you?
Sep 3 '08 #56
On 3 Sep 2008 at 20:07, Pilcrow wrote:
On Wed, 03 Sep 2008 17:07:00 +0200, jacob navia <ja***@nospam.c om>
wrote:
>>Exactly. C has "modules", and the interface is simple and efficient.
There is an enormous amount of C libraries around.

I am so glad to hear that. Perhaps someone would be so kind as to post
a list of them? At least the more important ones. URL's would be nice.
http://packages.debian.org/stable/libdevel/

Sep 3 '08 #57
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.
To which you responded (without presenting even a single Message-ID):
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.
You've cited a lot of evidence suggesting that Doug Gwyn opposes
particular changes to the standard. That was never in question. Any
reasonable person will, occasionally, oppose particular changes to the
standard, and sometimes for reasons that are wrong. Doug has
occasionally also spoken in favor of particular changes to the
standard. Personally, I favor more changes to the standard than he
does, and fewer than you do. However, that's all very different from
your slanderous claim that
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,
Nothing you've cited above says anything about "no new development".
Where, precisely, did Doug Gwyn (or anyone else on the committee)
express THAT opinion? And this time, please provide precise message
identification.
Sep 3 '08 #58
ja*********@ver izon.net wrote:
While such a suggestion is on-topic in that group, it is still not the
right place to make your proposal. Only a small number of committee
members participate in that group. If you really want anything to
change, you have to present your proposal to the committee, or at
least convince one of the committee members that your ideas have
sufficient merit to for that committee member to present them for you.
The committee members ore the ONLY ones who can actually make it
happen - nothing you say to anyone else will have much effect.
I need 10 thousand euros (15 000 US$) to buy the AFNOR
(French ISO organization) to present my proposal after
I got sponsored by some company.

I do not have either the sponsors nor that amount of money.

And I have repeated this MANY times, to you and to others.

And you STILL tell me to present proposals to ISO.

I do not have the financial resources for that is that clear?
Further piece of advice: if and when you actually make your proposals
to the committee, please try to lay off on the slanderous accusations
that pepper your typical postings in this newsgroup. Even if those
accusations were true, you couldn't possibly expect accusations of
idiocy, incompetence, and laziness to make the people you so accuse
more willing to cooperate with you, could you?
I have never said that they are idiots or lazy or whatever. You
are just lying (as you often do)
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 3 '08 #59
jacob navia wrote, On 03/09/08 22:18:
ja*********@ver izon.net wrote:
>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.

To which you responded (without presenting even a single Message-ID):

This was written by Gwyn the 10/4/2007 7:43 PM, with Message ID
<47************ ***@null.netThr ead name "C needs a BOOST"
<snip>
The only real use for such a library would be for new program
development, once the learning hurdle has been overcome. Much
^^^^
new development really ought to use higher-level languages in
the first place.
<snip>
Yes, you read correctly.
"Much new development really ought to use higher level languages"
^^^^
than C.

This is in essence what I said.
No, it is very different from what you claimed he said. Much freight is
transported by ship, but that does not prevent freight from being
transported by rail, road and plane. Most Chinese speakers live in
China, yet I hear Chinese being spoken in England by people living in
England.

<snip>
My opinion, based on considerable experience in this area, is that
C remains the best choice for much "systems implementation" work,
but that it is more cost-effective to use other, higher-level
languages for many "applicatio ns".
^^^^

Many is not all.

<snip>
It is (in my opinion) a mistake to try to push C (in any variant)
as a general solution for all programming problems. It's a
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
good choice for the systems programming that it was designed for,
although it still has deficiencies even for that. I would rather
the time spent discussing directions for C concentrate more on
remedies for its remaining deficiencies for systems work than on
trying to support applications where there are better choices.
Are you claiming that C should be used as a general solution to ALL
programming problems?
He says "it is not what I said"... then repeats everything again.
Nowhere in what you have quoted has he said that no new development or
applications should be done in C. He has also stated that he does want
some changes to the language, for how can the deficiencies be remedied
without changing the language?
C is good only for systems work, etc etc,
You are miss-quoting here what you have quoted above.
new development or
application dveelopment should be done in better languages, etc.
He said much, not all.
--
Flash Gordon
Sep 3 '08 #60

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

Similar topics

3
6557
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 is mapped through a drive letter and can drop stuff into the Unix box. It is going through another...
2
5673
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 snippet..
0
6448
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 executes. The unix box communicates back a 1 if the test is successful and a 0 if it is
1
17721
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 not availble on our Digital Unix and AIX platforms) Make searches case insensitive by default (yes, I...
6
1671
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
4275
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 = system 'cleartool setview admin_view'; $Result = system ('cleartool mount /vobs/test');
4
3792
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 like follows:
4
4274
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
3983
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
9506
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7525
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.