473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

overloading, template, exception handling and c

Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?

May 15 '06 #1
29 1733
v4vijayakumar a écrit :
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?


Well, the lcc-win32 C compiler provides some of those.

See the document
ftp://ftp.cs.virginia.edu/pub/lcc-win32/proposal.pdf

for a detailed description
May 15 '06 #2
v4vijayakumar wrote:
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?

Because they can be found elsewhere, C++ for example. C does what it
does, if you want do do something else, use another tool.

--
Ian Collins.
May 15 '06 #3
Ian Collins wrote:
Because they can be found elsewhere, C++ for example. C does what it
does, if you want do do something else, use another tool.


the question is "why these are not C yet?". IMHO, If C++ or any other
programming languages have these then it can not be a solution to C.

May 15 '06 #4
v4vijayakumar wrote:
Ian Collins wrote:
Because they can be found elsewhere, C++ for example. C does what it
does, if you want do do something else, use another tool.

the question is "why these are not C yet?". IMHO, If C++ or any other
programming languages have these then it can not be a solution to C.

The answer is why should they be in C?

This has been asked many times before, have a look though the group
archives.

--
Ian Collins.
May 15 '06 #5

Ian Collins wrote:
v4vijayakumar wrote:
Ian Collins wrote:
Because they can be found elsewhere, C++ for example. C does what it
does, if you want do do something else, use another tool.

the question is "why these are not C yet?". IMHO, If C++ or any other
programming languages have these then it can not be a solution to C.

The answer is why should they be in C?


I think a better answer is: "they aren't in C **yet** because
they never will be. The never will be because they don't belong."

It's like asking: "when will assembly have garbage collection?"
or "when will VHDL provide a tty interface?".

May 15 '06 #6
C is, at heart, a systems programming language. It has to be able to
run without a runtime environment, and often on very small computers.
Adding such features would reduce the usefulness of the language for
many important purposes.

May 15 '06 #7
Je*********@gmail.com wrote:
C is, at heart, a systems programming language. It has to be able to
run without a runtime environment, and often on very small computers.
Adding such features would reduce the usefulness of the language for
many important purposes.


What features? Please read the information below.

Brian
--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
May 15 '06 #8
Je*********@gmail.com wrote:

Please provide context when replying. See the Google section at
http://clc-wiki.net/wiki/Intro_to_clc
C is, at heart, a systems programming language. It has to be able to
run without a runtime environment,
That will be why it has a library defined by the standard then, so that
there is no run time support...
and often on very small computers.
Adding such features would reduce the usefulness of the language for
many important purposes.


Possibly. A bigger reason in my opinion is that there are already
languages with those things, so why turn C in to one?
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
May 15 '06 #9
"Je*********@gmail.com" wrote:

C is, at heart, a systems programming language. It has to be able to
run without a runtime environment, and often on very small computers.
Adding such features would reduce the usefulness of the language for
many important purposes.


What features?

In general on usenet you should realize that readers may very well
not have convenient access to previous articles in a thread. That
means that your reply articles should include adequate context, so
that they stand by themselves. Google is NOT usenet, it is only a
very poor interface to the real usenet system. To include proper
context when using google, see my sig. below. Please be sure to
read the referenced URLs.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
May 15 '06 #10
On 15 May 2006 03:43:45 -0700, "v4vijayakumar"
<v4***********@yahoo.com> wrote in comp.lang.c:
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?


Common sense.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
May 16 '06 #11

Je*********@gmail.com wrote:
C is, at heart, a systems programming language. It has to be able to
run without a runtime environment, and often on very small computers.
Adding such features would reduce the usefulness of the language for
many important purposes.


Overloading, template function, exception handling will not affect the
portability or simplicity of the language. These are mechanisms and not
policies. A language should be mechanisms rich and free of any
policies. Implementing 'garbage collection' into C could cause an
effect on running it in small computers, because 'garbage collection'
is a policy.

May 16 '06 #12
I think I am wrong. kindly ignore my previous message.

v4vijayakumar wrote:
Je*********@gmail.com wrote:
C is, at heart, a systems programming language. It has to be able to
run without a runtime environment, and often on very small computers.
Adding such features would reduce the usefulness of the language for
many important purposes.


Overloading, template function, exception handling will not affect the
portability or simplicity of the language. These are mechanisms and not
policies. A language should be mechanisms rich and free of any
policies. Implementing 'garbage collection' into C could cause an
effect on running it in small computers, because 'garbage collection'
is a policy.


May 16 '06 #13
v4vijayakumar wrote:
Je*********@gmail.com wrote:
C is, at heart, a systems programming language. It has to be able
to run without a runtime environment, and often on very small
computers. Adding such features would reduce the usefulness of
the language for many important purposes.


Overloading, template function, exception handling will not affect
the portability or simplicity of the language. These are mechanisms
and not policies. A language should be mechanisms rich and free of
any policies. Implementing 'garbage collection' into C could cause
an effect on running it in small computers, because 'garbage
collection' is a policy.


However allowing for the possible use of these added mechanisms
will seriously complicate simple code.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
May 16 '06 #14
CBFalconer a écrit :
v4vijayakumar wrote:
Je*********@gmail.com wrote:

C is, at heart, a systems programming language. It has to be able
to run without a runtime environment, and often on very small
computers. Adding such features would reduce the usefulness of
the language for many important purposes.


Overloading, template function, exception handling will not affect
the portability or simplicity of the language. These are mechanisms
and not policies. A language should be mechanisms rich and free of
any policies. Implementing 'garbage collection' into C could cause
an effect on running it in small computers, because 'garbage
collection' is a policy.

However allowing for the possible use of these added mechanisms
will seriously complicate simple code.


How?

I have explicitely pointed out that this can't affect any existing code.
You fail to bring any new argument. Just assertions without any proof.
May 16 '06 #15
jacob navia wrote:
CBFalconer a écrit :
v4vijayakumar wrote:
Je*********@gmail.com wrote:

C is, at heart, a systems programming language. It has to be able
to run without a runtime environment, and often on very small
computers. Adding such features would reduce the usefulness of
the language for many important purposes.

Overloading, template function, exception handling will not affect
the portability or simplicity of the language. These are mechanisms
and not policies. A language should be mechanisms rich and free of
any policies. Implementing 'garbage collection' into C could cause
an effect on running it in small computers, because 'garbage
collection' is a policy.


However allowing for the possible use of these added mechanisms
will seriously complicate simple code.


How?

I have explicitely pointed out that this can't affect any existing
code. You fail to bring any new argument. Just assertions without
any proof.


You have expressed your *opinion* that there are no effects. The
actuality is different, as almost anyone who has ever designed a
runtime system from the ground up should know.

Let's take overloading as a horrible example. You have a choice -
add a hidden parameter to each function call to identify the flavor
(which automatically affects the code), or effectively do the same
thing by name mangling. Now how do you handle the __function__ (I
think) provision of the standard? How do you ensure that the
linkage system can handle the mangled names. You may further
restrict the length of user function names to accomodate the
linker. Or other ugly things, totally unexpected by the innocent
programmer.

Think of the nasty effects of unwinding stack markers for an
exception.

Bear in mind that being able to do something cheaply on an x86
windoze machine running the worlds most unsafe operating system
does not mean it is feasible everywhere. You are playing in a
narrow crevice in the C world.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
May 16 '06 #16
CBFalconer a écrit :
Let's take overloading as a horrible example. You have a choice -
add a hidden parameter to each function call to identify the flavor
(which automatically affects the code), or effectively do the same
thing by name mangling.
How can name mangling affect efficiency?
Now how do you handle the __function__ (I
think) provision of the standard?
you get a very long function name like
_operator_plus_Sometype_SomeType
How do you ensure that the
linkage system can handle the mangled names.
Modern linkers accept very long names...
You may further
restrict the length of user function names to accomodate the
linker. Or other ugly things, totally unexpected by the innocent
programmer.

I still fail to see what this has to do with efficiency.
Think of the nasty effects of unwinding stack markers for an
exception.

?????
What is that?
Where in the proposed document is that mentioned?

Stop inventing things please.
Bear in mind that being able to do something cheaply on an x86
windoze machine running the worlds most unsafe operating system
does not mean it is feasible everywhere. You are playing in a
narrow crevice in the C world.


If you do not like Windows do not use it. Nobody is forcing you to use it.
May 16 '06 #17

v4vijayakumar wrote:
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?


Let me conclude.

1. c will be neat and simple as always.

2. completeness to c is not when "there is nothing more to add to it"
but "there is nothinng more to remove"

3. (c + something) can only be c++/d/c+2, but c will stay c only.

4. (please add more easy-to-understand points here...)

TIA.

May 16 '06 #18
On 2006-05-16, jacob navia <ja***@jacob.remcomp.fr> wrote:
CBFalconer a écrit :
Let's take overloading as a horrible example. You have a choice -
add a hidden parameter to each function call to identify the flavor
(which automatically affects the code), or effectively do the same
thing by name mangling.
How can name mangling affect efficiency?
Now how do you handle the __function__ (I
think) provision of the standard?


you get a very long function name like
_operator_plus_Sometype_SomeType

Will the Standard dictate how to mangle names? Or will
the user-programmer have to open up the object code every
recompile to see what his function is actually called?
How do you ensure that the
linkage system can handle the mangled names.


Modern linkers accept very long names...

Of course, people manually linking assembler with C
will have to figure out what functions do what, as
he won't have any function names to compare.
You may further
restrict the length of user function names to accomodate the
linker. Or other ugly things, totally unexpected by the innocent
programmer.

I still fail to see what this has to do with efficiency.

The last 9 words seem unnecessary.
Think of the nasty effects of unwinding stack markers for an
exception.


?????
What is that?
Where in the proposed document is that mentioned?

Stop inventing things please
Bear in mind that being able to do something cheaply on an x86
windoze machine running the worlds most unsafe operating system
does not mean it is feasible everywhere. You are playing in a
narrow crevice in the C world.


If you do not like Windows do not use it. Nobody is forcing you to use it.

If you modify C so that only on Wintel will your code
run quickly, you are indeed forcing people to use
Windows.
May 16 '06 #19
Andrew Poelstra a écrit :
On 2006-05-16, jacob navia <ja***@jacob.remcomp.fr> wrote:
CBFalconer a écrit :
Let's take overloading as a horrible example. You have a choice -
add a hidden parameter to each function call to identify the flavor
(which automatically affects the code), or effectively do the same
thing by name mangling.
How can name mangling affect efficiency?

Now how do you handle the __function__ (I
think) provision of the standard?


you get a very long function name like
_operator_plus_Sometype_SomeType


Will the Standard dictate how to mangle names? Or will
the user-programmer have to open up the object code every
recompile to see what his function is actually called?


Please read the proposal. There I describe an algorithm for choosing the
overloaded/operator function.
How do you ensure that the
linkage system can handle the mangled names.


Modern linkers accept very long names...


Of course, people manually linking assembler with C
will have to figure out what functions do what, as
he won't have any function names to compare.


I have proposed a method to avoid mangling for overloaded functions.
Please read the document.

If you do not like Windows do not use it. Nobody is forcing you to use it.


If you modify C so that only on Wintel will your code
run quickly, you are indeed forcing people to use
Windows.

Linux uses the same CPU, and nothing in the proposal is windows specific.

Just polemic, polemic, polemic.
May 16 '06 #20
jacob navia said:
Andrew Poelstra a écrit :
If you modify C so that only on Wintel will your code
run quickly, you are indeed forcing people to use
Windows.


Linux uses the same CPU, and nothing in the proposal is windows specific.


Linux is not constrained to x86. Also, there are other platforms than Linux
and Windows.
Just polemic, polemic, polemic.


Oh, be fair to yourself. You don't /just/ spout polemic. You also advertise
your product, over and over again. The rest of us don't do that. Why do you
think it's okay for you to do it?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
May 16 '06 #21
On 2006-05-16, jacob navia <ja***@jacob.remcomp.fr> wrote:
Andrew Poelstra a écrit :
On 2006-05-16, jacob navia <ja***@jacob.remcomp.fr> wrote:
CBFalconer a écrit :

Let's take overloading as a horrible example. You have a choice -
add a hidden parameter to each function call to identify the flavor
(which automatically affects the code), or effectively do the same
thing by name mangling.

How can name mangling affect efficiency?
Now how do you handle the __function__ (I
think) provision of the standard?

you get a very long function name like
_operator_plus_Sometype_SomeType

Will the Standard dictate how to mangle names? Or will
the user-programmer have to open up the object code every
recompile to see what his function is actually called?


Please read the proposal. There I describe an algorithm for choosing the
overloaded/operator function.

g++, MSVC++, and various other compilers use different algorithms,
none of which are the same as yours (at most one is the same), and
one that I designed is different from all of them! Name mangling
locks you into a specific compiler, and frequently a single CPU or
operating system.
How do you ensure that the
linkage system can handle the mangled names.

Modern linkers accept very long names...


Of course, people manually linking assembler with C
will have to figure out what functions do what, as
he won't have any function names to compare.


I have proposed a method to avoid mangling for overloaded functions.
Please read the document.

The two functions need to be different, because of the way that C
interfaces with [x86] assembler. I don't want that kind of added
complexity.

If you do not like Windows do not use it. Nobody is forcing you to use it.


If you modify C so that only on Wintel will your code
run quickly, you are indeed forcing people to use
Windows.

Linux uses the same CPU, and nothing in the proposal is windows specific.

As Richard said, Linux is not constrained to x86. I personally have written
code for x86, x86_64, PPC, ARM, NES, and the Linksys WRT54G. (I'm not sure
what exact processor the last two use). I know that I can do C on all those
systems reasonably efficently, thanks to C's low-level nature. With a lot
of your proposed add-ons, I'd lose that low-level-icity.
Just polemic, polemic, polemic.

You are arguing as well, and advertising too.
May 16 '06 #22
jacob navia wrote:
Andrew Poelstra a écrit :

.... snip ...

If you modify C so that only on Wintel will your code
run quickly, you are indeed forcing people to use
Windows.


Linux uses the same CPU, and nothing in the proposal is windows
specific.

Just polemic, polemic, polemic.


No, Linux CAN use the same CPU. It can also use other CPUs. How
many distinct CPU architectures does LCC-Win32 run on? I have
noted before that it doesn't even run on a '486 executing W98,
which is not by any measure a distinct architecture from a
Pentium. Does this bode well for your assertions that the
proposals are portable?

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
May 16 '06 #23

v4vijayakumar wrote:
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?


We already have C++.

May 16 '06 #24

John Bode wrote:
v4vijayakumar wrote:
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?


We already have C++.


yes. we already have comp.lang.c++ too!

May 17 '06 #25
v4vijayakumar wrote:
John Bode wrote:
v4vijayakumar wrote:
Why there is no overloading (function and operator), function templates
and exception handling support in c? after all these are all useful
programming constructs.

What prevents ANSI/ISO committee to add these into c?


We already have C++.


yes. we already have comp.lang.c++ too!


And we already have enough trolls in this group too!

May 17 '06 #26

santosh wrote:
v4vijayakumar wrote:
John Bode wrote:
v4vijayakumar wrote:
> Why there is no overloading (function and operator), function templates
> and exception handling support in c? after all these are all useful
> programming constructs.
>
> What prevents ANSI/ISO committee to add these into c?

We already have C++.


yes. we already have comp.lang.c++ too!


And we already have enough trolls in this group too!


I don't know what a troll is before reading
http://en.wikipedia.org/wiki/Internet_troll. I think I am not the one.

I am convinced by two answers to my question.

1. common sense
2. we already have c++

but, I am looking for some concrete answers and still I hope.

May 18 '06 #27
v4vijayakumar wrote:
santosh wrote:
v4vijayakumar wrote:
John Bode wrote:
> v4vijayakumar wrote:
> > Why there is no overloading (function and operator), function templates
> > and exception handling support in c? after all these are all useful
> > programming constructs.
> >
> > What prevents ANSI/ISO committee to add these into c?
>
> We already have C++.

yes. we already have comp.lang.c++ too!
And we already have enough trolls in this group too!


I don't know what a troll is before reading
http://en.wikipedia.org/wiki/Internet_troll. I think I am not the one.


Okay, tell me what you think tommorow.
I am convinced by two answers to my question.

1. common sense
Of which you can do with some.
2. we already have c++
Thanks for the timely reminder. Bjarne will be greatful to you.
but, I am looking for some concrete answers and still I hope.


I'm inspired by your positive attitude.

May 18 '06 #28
v4vijayakumar wrote:

santosh wrote:
v4vijayakumar wrote:
John Bode wrote:
> v4vijayakumar wrote:
> > Why there is no overloading
> > (function and operator), function templates
> > and exception handling support in c?
> > after all these are all useful
> > programming constructs.
> >
> > What prevents ANSI/ISO committee to add these into c?
>
> We already have C++.

yes. we already have comp.lang.c++ too!


And we already have enough trolls in this group too!


I don't know what a troll is before reading
http://en.wikipedia.org/wiki/Internet_troll. I think I am not the one.

I am convinced by two answers to my question.

1. common sense
2. we already have c++

but, I am looking for some concrete answers and still I hope.


"The way that C should be",
regarding proposals for new features and such,
is on topic on
news:comp.std.c

Try to organize your thoughts very well before posting there.
They're not as technically casual over there, as we are here.

--
pete
May 18 '06 #29
pete wrote:
v4vijayakumar wrote:
santosh wrote:
v4vijayakumar wrote:
John Bode wrote:
> v4vijayakumar wrote:
>
>> Why there is no overloading
>> (function and operator), function templates
>> and exception handling support in c?
>> after all these are all useful
>> programming constructs.
>>
>> What prevents ANSI/ISO committee to add these into c?
>
> We already have C++.

yes. we already have comp.lang.c++ too!

And we already have enough trolls in this group too!


I don't know what a troll is before reading
http://en.wikipedia.org/wiki/Internet_troll. I think I am not the one.

I am convinced by two answers to my question.

1. common sense
2. we already have c++

but, I am looking for some concrete answers and still I hope.


"The way that C should be",
regarding proposals for new features and such,
is on topic on
news:comp.std.c

Try to organize your thoughts very well before posting there.
They're not as technically casual over there, as we are here.


Come on. Isn't it obvious that v4vijayakumar has a language
barrier, and that he has accepted the primary reasons for no silly
extensions. It is high time to put this thread to the natural
death it deserves.

--
Some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html
May 18 '06 #30

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

Similar topics

17
by: Terje Slettebø | last post by:
To round off my trilogy of "why"'s about PHP... :) If this subject have been discussed before, I'd appreciate a pointer to it. I again haven't found it in a search of the PHP groups. The PHP...
4
by: Dave Theese | last post by:
Hello all, I'm trying to get a grasp of the difference between specializing a function template and overloading it. The example below has a primary template, a specialization and an overload. ...
16
by: WittyGuy | last post by:
Hi, What is the major difference between function overloading and function templates? Thanks! http://www.gotw.ca/resources/clcm.htm for info about ]
9
by: learning | last post by:
hi I am trying to make some simple app to learn exception safety coding. I know that new and delete can throw bad_alloc but how can I force them to throw by a flag "change" at run time? I am...
45
by: charles.lobo | last post by:
Hi, I have recently begun using templates in C++ and have found it to be quite useful. However, hearing stories of code bloat and assorted problems I decided to write a couple of small programs...
14
by: Pramod | last post by:
I have one question. Can I catch exception in function overloading.In my programm i want to create two function with same signature and same return type. I know its not possible...can i use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.