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 7321
On Tue, 02 Sep 2008 04:48:57 -0700, Pilcrow <pi*****@pp.inf owrote:
>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 communicatio n, 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?
So many people have accused me of having a hidden agenda that I feel I
should declare my agenda explicitly. I am a man who has had a bit of
programming experience, most recently with Perl, who is now trying to
acquire a working knowledge of C, sufficient to do the kinds of things I
am used to doing with Perl. I ask provocative questions in the attempt
of gaining new knowledge, especially as to the resources available to
the C programmer who is trying not to have to reinvent the wheel, but I
seem to have ruffled some feathers, for which I apologize. Please bear
with me, and be patient.
I already have gotten some answers, such as the existence of the
locale.h header file, which I should have noticed before.
I again apologize to all of you, but C, though faster than Perl, seems
to me very constricting. I am still working my way through K&R2, (and
posting some of my solutions on clc-wiki), so maybe there will be an
epiphany soon. I hope so.
On Tue, 2 Sep 2008 16:13:34 -0700 (PDT), ja*********@ver izon.net wrote:
>Pilcrow wrote:
>On Tue, 2 Sep 2008 12:32:15 -0700 (PDT), ja*********@ver izon.net wrote:
>Pilcrow wrote:
...
>How could I do the same sort of thing using C? Is there a repository of libraries for C, similar to CPAN for Perl? If not, is anyone working on it?
There is no single repository for C libraries which plays the same role for C that CPAN does for perl, but I would guess that many
why do you have to guess? ...
Because I don't possess enough information to be certain, one way or the other. Do you? If your question was just rheotorical, as now seems to be the case, then all you're doing is trolling this newsgroup to promote perl as a superior alternative to C. I know too much about perl to fall for that one: perl has a number of advantages over C in particular contexts, and i use it routinely when those contexts apply, but it has nowhere near enough advantages to replace C in all contexts. I wouldn't dream of using it for any of the tasks that I currently use C for.
>... CPAN is so much integrated with Perl, that whenever Perl is installed, the access to CPAN (cpan.pm) is automaticall y included (unless you're installing ActiveState Perl, and a similar facility is provided there).
I can't figure out what relevance that has to my guesswork. It almost seems as if you're saying that a C repository cannot count as "similar" unless access to that repository is automatically installed when you install your C compiler; but I can't imagine that you're making such a fatuous suggestion.
>similar repositories do exist for C code. What you're asking about is mostly a social issue having to do with how CPAN works; it isn't related to any technical differences between C and perl. Personally, the repository I have the most familiarity with is sourceforge.net , which handles a lot more than just C libraries.
Similar repositories? How do I search them? Do they include documentatio n? Are they cross-platform compatible?
The only such repository I'm familiar with is sourceforge.net . If you check out their web site, it's pretty obvious how to search it. Documentatio n seems to be the norm, not the exception, but I'm sure that the quality of the documentation is highly variable. I'm sure that cross-platform compatibility is also highly variable. That's pretty much unavoidable when source code comes from such a wide variety of sources.
I apologize. I don't think Perl is superior to C. Every Perl
programmer, however, knows of the existence of CPAN. I was trying to
find how I could find tested solutions in C, similar to the tested
solutions of CPAN, so that I don't have to reinvent the wheel with every
new task. I will try to explore sourceforge more thoroughly, which I
have already used for various utilities.
On Tue, 02 Sep 2008 21:25:09 -0700, Pilcrow posted:
>>The only such repository I'm familiar with is sourceforge.net . If you check out their web site, it's pretty obvious how to search it. Documentati on seems to be the norm, not the exception, but I'm sure that the quality of the documentation is highly variable. I'm sure that cross-platform compatibility is also highly variable. That's pretty much unavoidable when source code comes from such a wide variety of sources.
I apologize. I don't think Perl is superior to C. Every Perl
programmer, however, knows of the existence of CPAN. I was trying to
find how I could find tested solutions in C, similar to the tested
solutions of CPAN, so that I don't have to reinvent the wheel with every
new task. I will try to explore sourceforge more thoroughly, which I
have already used for various utilities.
You're not going to find CPAN here with the unterlanguage. It requires an
ecumenism that doesn't exist for C. Not sure why.
Every time time you "reinvent the wheel," you have to have a caller and a
target. I find that crossing syntax avoids weaknesses in given syntaxes.
Now that I think about it, the first reason for the lack of ecumenism is
history and the second is that there are dozens of competing
implementations of C while perl competes more convincingly for a
narrowslice, like sysadmins.
--
What men value in this world is not rights but privileges. 7
H. L. Mencken
On 3 Sep, 07:47, Ron Ford <r...@example.i nvalidwrote:
On Tue, 02 Sep 2008 21:25:09 -0700, Pilcrow posted:
>The only such repository I'm familiar with is sourceforge.net . If you check out their web site, it's pretty obvious how to search it. Documentatio n seems to be the norm, not the exception, but I'm sure that the quality of the documentation is highly variable. I'm sure that cross-platform compatibility is also highly variable. That's pretty much unavoidable when source code comes from such a wide variety of sources.
I apologize. *I don't think Perl is superior to C. *Every Perl
programmer, however, knows of the existence of CPAN. *I was trying to
find how I could find tested solutions in C, similar to the tested
solutions of CPAN,
C has no equivalent to CPAN. But then CPAN is pretty unique
to perl. You could say it was one of perl's selling points.
so that I don't have to reinvent the wheel with every
new task. *I will try to explore sourceforge more thoroughly, which I
have already used for various utilities.
You're not going to find CPAN here with the unterlanguage. *It requiresan
ecumenism that doesn't exist for C. *Not sure why.
Every time time you "reinvent the wheel," you have to have a caller and a
target. *
>I find that crossing syntax avoids weaknesses in given syntaxes.
what does that mean? Is it even english?
Now that I think about it, the first reason for the lack of ecumenism is
history and the second is that there are dozens of competing
implementations of C while perl competes more convincingly for a
narrowslice, like sysadmins.
effectivly there is only one perl implementation
--
Nick Keighley
I have found that all ugly things are made by those who strive to make
something beautiful and that all beautiful things are made by those
who
strive to make something useful.
-- Oscar Wilde
Pilcrow wrote, On 03/09/08 05:25:
<snip>
I apologize. I don't think Perl is superior to C. Every Perl
programmer, however, knows of the existence of CPAN. I was trying to
find how I could find tested solutions in C, similar to the tested
solutions of CPAN, so that I don't have to reinvent the wheel with every
new task. I will try to explore sourceforge more thoroughly, which I
have already used for various utilities.
Every Linux distribution comes with shed loads of libraries that are
accessible through C. Every OS provides a number of system specific
libraries for doing certain things (such as networking & graphics if the
system supports them natively, as modern personal computers generally
do). There are commercially available libraries for a number of tasks if
you can pay the money and live with the licensing terms. There are
things like Sourceforge. A number of posters here have their own
libraries they make available. However, there are things which are
fundamentally easier in Perl even if you have C libraries to do the
donkey work for you.
Oh, and modules in CPAN don't always work on all systems to which Perl
has been ported (I had some problems with modules on SCO a few years
back), so C libraries for specific tasks not always being portable to
everywhere is no different.
--
Flash Gordon
Pilcrow <pi*****@pp.inf owrote:
On Tue, 2 Sep 2008 12:32:15 -0700 (PDT), ja*********@ver izon.net wrote:
There is no single repository for C libraries which plays the same
role for C that CPAN does for perl, but I would guess that many
why do you have to guess? CPAN is so much integrated with Perl, that
whenever Perl is installed, the access to CPAN (cpan.pm) is
automatically included
That's a neat trick, given that I've installed PERL on machines without
internet access.
Richard
On Wed, 3 Sep 2008 00:23:52 -0700 (PDT), Nick Keighley posted:
On 3 Sep, 07:47, Ron Ford <r...@example.i nvalidwrote:
>On Tue, 02 Sep 2008 21:25:09 -0700, Pilcrow posted:
>>>>The only such repository I'm familiar with is sourceforge.net . If you check out their web site, it's pretty obvious how to search it. Documentati on seems to be the norm, not the exception, but I'm sure that the quality of the documentation is highly variable. I'm sure that cross-platform compatibility is also highly variable. That's pretty much unavoidable when source code comes from such a wide variety of sources.
>>I apologize. *I don't think Perl is superior to C. *Every Perl programmer, however, knows of the existence of CPAN. *I was trying to find how I could find tested solutions in C, similar to the tested solutions of CPAN,
C has no equivalent to CPAN. But then CPAN is pretty unique
to perl. You could say it was one of perl's selling points.
Absolutely. The rest of us, eg, c, c++, c sharp, c flat, fortran, fortran
flat and karaoke, best note the strength of perl's syntax.
>
>>so that I don't have to reinvent the wheel with every new task. *I will try to explore sourceforge more thoroughly, which I have already used for various utilities.
You're not going to find CPAN here with the unterlanguage. *It requires an ecumenism that doesn't exist for C. *Not sure why.
Every time time you "reinvent the wheel," you have to have a caller and a target. *
>>I find that crossing syntax avoids weaknesses in given syntaxes.
what does that mean? Is it even english?
Since texans have monopolized vapidity, I'm afraid the answer is yes. I
can't make the point without posting a syntax which is not c, but that just
reminds me of texans, the not-constitution oil retards.
>
>Now that I think about it, the first reason for the lack of ecumenism is history and the second is that there are dozens of competing implementation s of C while perl competes more convincingly for a narrowslice, like sysadmins.
effectivly there is only one perl implementation
Right.
--
We must respect the other fellow's religion, but only in the sense and to
the extent that we respect his theory that his wife is beautiful and his
children smart. 5
H. L. Mencken
On Wed, 03 Sep 2008 08:27:34 GMT, Richard Bos posted:
Pilcrow <pi*****@pp.inf owrote:
>On Tue, 2 Sep 2008 12:32:15 -0700 (PDT), ja*********@ver izon.net wrote:
>>>There is no single repository for C libraries which plays the same role for C that CPAN does for perl, but I would guess that many
why do you have to guess? CPAN is so much integrated with Perl, that whenever Perl is installed, the access to CPAN (cpan.pm) is automaticall y included
That's a neat trick, given that I've installed PERL on machines without
internet access.
Richard
..pm brings you farther with perl and a net connection than your installs.
--
Unquestionably, there is progress. The average American now pays out twice
as much in taxes as he formerly got in wages. 1
H. L. Mencken
Pilcrow wrote:
....
am used to doing with Perl. I ask provocative questions in the attempt
of gaining new knowledge, ...
Asking provocative questions tends, by definition, to provoke negative
reactions. I'd recommend asking interesting questions, rather than
provocative ones.
....
I already have gotten some answers, such as the existence of the
locale.h header file, which I should have noticed before.
I didn't realize that you were that unfamiliar with C, and therefore
misunderstood your comments as a dismissal of <locale.has being
insufficiently powerful. It might be insufficiently powerful; C++'s
support for locales, for instance, is much more sophisticated - so much
so that I can't quite figure out how to take advantage of it's powerful
capabilities - so there's certainly room for improvement (in both
languages).
James Kuyper <ja*********@ve rizon.netwrites :
Pilcrow wrote:
...
>am used to doing with Perl. I ask provocative questions in the attempt of gaining new knowledge, ...
Asking provocative questions tends, by definition, to provoke negative
reactions. I'd recommend asking interesting questions, rather than
provocative ones.
"Provocativ e" means interesting. It does not mean it needs an aggressive
reply. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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..
|
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
|
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...
|
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;
| |
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');
|
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:
|
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.
|
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?
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| | |