473,802 Members | 1,978 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 7403
CBFalconer <cb********@yah oo.comwrote:
jacob navia wrote:
Richard wrote:
I would sooner boil my nuts in a vat of sun flower oil than agree
that operator overloading in C is a good idea.
Should I send you olive oil maybe?

Ahh. The first real progress seen in this thread. :-)
For boiling nuts, arachis oil is the obvious choice.

Richard
Sep 8 '08 #171
On Sep 4, 6:15*pm, Flash Gordon <s...@flash-gordon.me.ukwro te:
jacob navia wrote, On 04/09/08 00:08:
Because it is a *simple* language. Simple languages are easier to
understand and use, and have less surface for bugs.

I've seen a lot of bugs in code written in simpler languages.
Could you elaborate? What are the mainstream programming languages
(as in those languages with a reasonable number of programs written
using them) that you consider to be simpler than C?

- Anand
Sep 8 '08 #172
rio

"jacob navia" <ja***@nospam.c omha scritto nel messaggio
news:g9******** **@aioe.org...
Richard wrote:
It *is* easier to write
c = a+b
than c = sum(a,b);
the answer is not full
it will be full if

c = a+b;
if(c==ERRORVALU E) goto error;

or

c = a+b;

and some definition of exception in case of overflow c

Sep 8 '08 #173
REH
On Sep 6, 1:44*pm, jacob navia <ja...@nospam.c omwrote:
TYPE operator [ ]=(TYPE table, int idx, ELEMENT_TYPE newvalue)
This would apply to

* * * * table[idx] = newvalue;

In C++ there is no way to distinguish between those
operations since you just return a pointer.

This is done to support read only data types, what is very hard in C++.
nonsense.

Read:
const TYPE& operator[](std::size_t i) const;

or, if you prefer by value:

TYPE operator[](std::size_t i) const;

Write:
TYPE& operator[](std::size_t i);

x = y[1]; would call the operator with the read prototype.

y[1] = x; would call the operator with the write prototype.

Sep 8 '08 #174
Anand Hariharan wrote, On 08/09/08 16:19:
On Sep 4, 6:15 pm, Flash Gordon <s...@flash-gordon.me.ukwro te:
>jacob navia wrote, On 04/09/08 00:08:
>>Because it is a *simple* language. Simple languages are easier to
understand and use, and have less surface for bugs.
I've seen a lot of bugs in code written in simpler languages.

Could you elaborate? What are the mainstream programming languages
(as in those languages with a reasonable number of programs written
using them) that you consider to be simpler than C?
Depending on your definition of simpler, I have...

Z80 assembler. This is a nice fairly simple assembly language and I've
seen lots of bugs in code written in it. It certainly was mainstream
back when I started using it, and there are a lot of NSC800 processors
(the military equivalent with a few extra built-in peripherals) still
flying around.

Pascal. This is simpler in terms of being in general a higher level
language without OO (which Jacob considers complex, and not without
reason), and I've seen lots of bugs in Pascal.

Choose a definition of simple and I am sure I can find a language I've
used which meets that definition.
--
Flash Gordon
Sep 8 '08 #175
Flash Gordon wrote:
....
Choose a definition of simple and I am sure I can find a language I've
used which meets that definition.
simpler := "more like C"

:-)
Sep 8 '08 #176
ja*********@ver izon.net wrote, On 08/09/08 20:32:
Flash Gordon wrote:
...
>Choose a definition of simple and I am sure I can find a language I've
used which meets that definition.

simpler := "more like C"

:-)
#define := =
#define = ==
#define Pascal C
#define :=) ;-)
--
#define Flash Mark
Flash Gordon
Sep 8 '08 #177
Flash Gordon wrote:
Anand Hariharan wrote, On 08/09/08 16:19:
>On Sep 4, 6:15 pm, Flash Gordon <s...@flash-gordon.me.ukwro te:
>>jacob navia wrote, On 04/09/08 00:08:
Because it is a *simple* language. Simple languages are easier to
understand and use, and have less surface for bugs.
I've seen a lot of bugs in code written in simpler languages.

Could you elaborate? What are the mainstream programming languages
(as in those languages with a reasonable number of programs written
using them) that you consider to be simpler than C?

Depending on your definition of simpler, I have...

Z80 assembler. This is a nice fairly simple assembly language and I've
seen lots of bugs in code written in it. It certainly was mainstream
back when I started using it, and there are a lot of NSC800 processors
(the military equivalent with a few extra built-in peripherals) still
flying around.

Pascal. This is simpler in terms of being in general a higher level
language without OO (which Jacob considers complex, and not without
reason), and I've seen lots of bugs in Pascal.

Choose a definition of simple and I am sure I can find a language I've
used which meets that definition.
I did NOT say that C has no bugs. Read what I wrote again:
>>jacob navia wrote, On 04/09/08 00:08:
Simple languages are easier to
understand and use, and have less surface for bugs.
Is that clear to you now?

"Less surface" means that, less surface, not NO bugs but fewer and
easier to find.

I consider C++ a very complex language where bugs have a lot more
places to hide.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 8 '08 #178
On Sep 8, 6:14*pm, jacob navia <ja...@nospam.c omwrote:
Flash Gordon wrote:
Anand Hariharan wrote, On 08/09/08 16:19:
On Sep 4, 6:15 pm, Flash Gordon <s...@flash-gordon.me.ukwro te:
jacob navia wrote, On 04/09/08 00:08:
Because it is a *simple* language. Simple languages are easier to
understand and use, and have less surface for bugs.
I've seen a lot of bugs in code written in simpler languages.
Could you elaborate? *What are the mainstream programming languages
(as in those languages with a reasonable number of programs written
using them) that you consider to be simpler than C?
Depending on your definition of simpler, I have...
Z80 assembler. This is a nice fairly simple assembly language and I've
seen lots of bugs in code written in it. It certainly was mainstream
back when I started using it, and there are a lot of NSC800 processors
(the military equivalent with a few extra built-in peripherals) still
flying around.
Pascal. This is simpler in terms of being in general a higher level
language without OO (which Jacob considers complex, and not without
reason), and I've seen lots of bugs in Pascal.
Choose a definition of simple and I am sure I can find a language I've
used which meets that definition.

I did NOT say that C has no bugs. Read what I wrote again:

*>>jacob navia wrote, On 04/09/08 00:08:
*>>>Simple languages are easier to
*>>>understand and use, and have less surface for bugs.

Is that clear to you now?

"Less surface" means that, less surface, not NO bugs but fewer and
easier to find.

Jacob - From what I read of Flash's response to my post, I understood
him as saying 'Jacob believes Pascal and/or Object Orientation to be
complex, and he is justified in believing it to be so'.
Flash - I agree with you in that, I consider Pascal to be simpler than
C. Since I have never had to maintain a code base in Pascal (my only
stint with Pascal was as a freshman in college, and I very likely
wrote buggy code, but I never had to review enough Pascal code to
uncover bugs), I can't offer an opinion about which language is
(inherently) more easily susceptible to bugs.
- Anand
Sep 8 '08 #179
Anand Hariharan wrote:
>
.... snip ...
>
Flash - I agree with you in that, I consider Pascal to be simpler
than C. Since I have never had to maintain a code base in Pascal
(my only stint with Pascal was as a freshman in college, and I
very likely wrote buggy code, but I never had to review enough
Pascal code to uncover bugs), I can't offer an opinion about
which language is (inherently) more easily susceptible to bugs.
I can. I spent many years concentrating on Pascal, building Pascal
systems and Pascal applications. Properly used Pascal is much less
bug susceptible than C. The point is that most such bugs will
appear at compilation time, and the code need never be run to debug
them. It is especially important to properly type design the
elements.

There is virtually no advantage for those who just write C using
Pascal code.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home .att.net>
Try the download section.
Sep 9 '08 #180

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

Similar topics

3
6559
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
6449
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
4275
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
9699
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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
10538
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
10285
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,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6838
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
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.