473,854 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Boost process and C

Hi,

Is there any group in the manner of the C++ Boost group that works on
the evolution of the C language? Or is there any group that performs an
equivalent function?

Thanks,
-vs

Apr 29 '06
335 11957
"Richard Tobin" wrote:
Joe Wright wrote:
Adding date values is nonsense.


Why? The averaging example I gave shows a perfectly clear use of
it.

It might be nonsense to claim that adding date values gives you a
date, but that's not what I said.

Another analogy: I have heard it claimed that adding celsius
temperatures is nonsense, yet people do it all the time when
averaging
temperatures.


There is a difference between

(date1+date2)/2 (adds dates and divides by two)

and

date1+(date2-date1)/2 (proportionally adds the difference between two
dates to another date)

The former is meaningless (in a mathematical sense), the latter is
perfectly legal.

If you argue that adding dates is legal then I suggest you define the
binary operator and the division-operator in a serious way. (e.g. it
should tell: What is (March, 13th 2003) / 2? )

Temperatures are a different thing. They have another mathematical
structure. Adding them does not make sense in a physical way... As it
is for dates. Averaging dates would be legal too but you would have to
find a mapping to the real numbers to do so.

That means you need to define the offset and the scale you want to
use. This does not give a meaning to the sum of two dates but enables
you to define the average date in a series.

regards
John
May 5 '06 #261
REH

"Ben C" <sp******@spam. eggs> wrote in message
news:sl******** *************@b owser.marioworl d...
Then I have completely misunderstood your point, which wouldn't be a
first
for me.


The original point was just that if you want the "full power" of
operator-overloading, combined with manual memory management, you also
need constructors, destructors and references. Or something like them.

That's all. Whether C should be extended with any or all of:

1. operator overloading
2. references
3. constructors and destructors

is a matter of opinion.


Ah, I gotta ya. Personally, I'd like C to stay small, simple, and compact.
I use C++ or Ada when I want those extra features, and still have a language
that is designed for efficiency.

REH
May 5 '06 #262
REH wrote:
"Ben C" <sp******@spam. eggs> wrote in message
news:sl******** *************@b owser.marioworl d...

Then I have completely misunderstood your point, which wouldn't be a
first
for me.


The original point was just that if you want the "full power" of
operator-overloading, combined with manual memory management, you also
need constructors, destructors and references. Or something like them.

That's all. Whether C should be extended with any or all of:

1. operator overloading
2. references
3. constructors and destructors

is a matter of opinion.

Ah, I gotta ya. Personally, I'd like C to stay small, simple, and compact.
I use C++ or Ada when I want those extra features, and still have a language
that is designed for efficiency.

REH


The operator overloading change do not affect efficiency at all. One of
the most "dreaded" features of C++ is the problem of avoiding
copy-constructors, constructors and destructors in apparently efficient
and simple statements like

a = *b;

or similar. This is nowhere required by operator overloading.

Of course some people will say that this is not the "full power" of
operator overloading, and I would just say that they are right. But I
would rename that to "full bloat" :-)

The problem of C++ is that it wasn't able to say STOP. It was unable to
see when features become misfeatures because of the incredible bloat
that they continued to accept.

One feature (operator overloading) led to another and to another and
they ended up with a language that nobody in the world can grasp as a
whole. Still, most C++ compilers do not arrive at full compliance
because of the incredible feature set. Look at the incredible efforts
done by the gcc team and still there is no 100% compliance.

This is a lesson to be learned.

Still, we must not fall in the opposite direction, and refuse any
change. I suspect that most of the animosity against the changes I
propose is precisely this feeling that C is going to disappear again in
a bloated stuff where the efficiency and the surface of the language is
extended beyond repair.

This is not AT ALL my intention. The proposed changes do not affect the
efficency at all, and they are really optional in the sense that the
efficiency loss is only paid by people that use them. In C++ you get
your constructors/destructors whether you want it or not. Operator
overloading is a change that will affect only people that use that
feature. Nobody else has to pay for it.

The same thing for ALL other changes that are done in lcc-win32:

o overloaded functions: No efficiency lost since the compiler generates
the same machine code as before. This is just compile time changes.
o operator overloading: No efficiency lost for people that do not use
this feature. Some cycles (minimal) of extra cost are there for simple
implementations like the one in lcc-win32. An optimizing compiler
would have no trouble in eliminating it.
o Default arguments: No efficiency loss at all. This is just some
syntatic sugar.

Note that in contrast to C++ C remains NOT object oriented!

jacob
May 5 '06 #263
On Fri, 05 May 2006 20:28:51 +0200, jacob navia
<ja***@jacob.re mcomp.fr> wrote:
REH wrote:
"Ben C" <sp******@spam. eggs> wrote in message
news:sl******** *************@b owser.marioworl d...

<snip>

That's all. Whether C should be extended with any or all of:

1. operator overloading
2. references
3. constructors and destructors

is a matter of opinion.


It's also off-topic here. Take it to comp.std.c.

<snip>

--
Al Balmer
Sun City, AZ
May 5 '06 #264
"John F" <sp**@127.0.0.1 > writes:
"Richard Tobin" wrote:
Joe Wright wrote:
Adding date values is nonsense.


Why? The averaging example I gave shows a perfectly clear use of
it.

It might be nonsense to claim that adding date values gives you a
date, but that's not what I said.

Another analogy: I have heard it claimed that adding celsius
temperatures is nonsense, yet people do it all the time when
averaging
temperatures.


There is a difference between

(date1+date2)/2 (adds dates and divides by two)

and

date1+(date2-date1)/2 (proportionally adds the difference between two
dates to another date)

The former is meaningless (in a mathematical sense), the latter is
perfectly legal.


[...]

The former includes a subexpression that yields a result that's not
meaningful, but the expression has a whole is meaningful.

Dates, temperatures, and pointers are all similar in the sense that
each can be thought of as a pair: base+offset, where the base is
respectively an arbitrary epoch, an arbitrary zero temperature, or a
zero address (or the base address of a containing object). In each
case, the "base" is some fixed point, and the "offset" is a scalar
quantity. Offsets by themselves can be added and subtracted freely;
the base is meaningful only if you have exactly zero or one of it.
(With no base, you have an interval or distance; with a base, you have
a position.)

(Assume Celsius or Fahrenheit temperatures; the zero base of Kelvin
scale is uniquely meaningful, so it's not restricted to this model.)

Subtracting two dates
date1 - date2
is equivalent to:
(base+offset1) - (base+offset2)
which reduces to:
offset1 - offset2
which is meaningful; it's an interval, measurable in seconds, with no
defined base.

Adding two dates:
date1 + date2
is equivalent to:
(base+offset1) + (base+offset2)
which reduces to:
2*base + offset1 - offset2
which is not directly meaningful because of the 2*base term.

However, if it's used as an intermediate expression, as in:
(date1 + date2) / 2
we have
((base+offset1) + (base+offset2)) / 2
or
(2*base + offset1 - offset2) / 2
or
base + (offset1 - offset2)/2
a meaningful expression that denotes the midpoint between the two
dates.

Ideally, we'd like to make expressions with meaningful results legal,
and expressions without meaningful results illegal. Theoretically, we
could do this by allowing meaningless intermediate results, as long as
the result of the full expression is meaningful.

There are (at least) two problems with this approach. First, it makes
the language rules more complex, which affects both compiler writers
(who can deal with it) and users (who likely can't). Try explaining
to a newbie that (date1 + date2), or (pointer1 + pointer2), is usually
illegal, except that it's allowed as a subexpression if and only if
the expression as a whole obeys certain constraints. Second, it makes
it difficult to define the circumstances in which overflow can occur.
Pointer arithmetic in C is defined only within a single object (or
just past its end); allowing pointer+pointer gives you intermediate
results that not only don't have an obvious meaning, but may not be
representable, depending on where in the address space the object
happens to be allocated.

Ignoring the overflow problem, if you're using raw numbers to
represent dates, something like (date1+date2)/2 is ok, as long as you
have the discipline to avoid writing a full expression that's not
meaningful:
x = date1 + date2; /* meaningless, but the compiler won't complain */

If you're using a hypothetical language that does this kind of smart
type checking, allowing date1+date2 as a subexpression but not as a
full expression, you can add dates to your heart's content and depend
on the implementation to detect any type matching errors. It would be
interesting to design this kind of thing, either as a language feature
(off-topic here), or as a library with run-time checking (doable in
standard C, with functions rather than overloaded operators). Again,
overflow is a concern unless you can either use extended precision for
intermediate results, or rely on the implementation to rearrange the
expressions for you.

Finally, if you're using standard C and operating on pointers, you'll
just have to rearrange the expression yourself. If you need to know
the address halfway between two pointers, you can't write:
mid = (ptr1 + ptr2) / 2;
You'll just have to bite the bullet and write:
mid = ptr1 + (ptr2 - ptr1) / 2;

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 5 '06 #265
Richard Bos wrote:
Ian Collins <ia******@hotma il.com> wrote:

Richard Bos wrote:
Functions which take a reference can change _my_ object behind my back,
and the only way I'd know about it is if I dug up the prototype. You
cannot tell from a single call. With pointers, the difference is always
clear. To illustrate:


That's why we have const. If a function isn't going to change the value
passed in, it should reference (or pointer) to a const object. If the
parameter isn't const, assume the worst. No difference between pointers
and references in this case.

But you still can't tell from any particular _call_ to a function
whether that function is likely to change its arguments, or is
guaranteed not to. As long as you have references (real ones, not
navia-references), you cannot trust a single function call - you have to
look up all prototypes, even if you're only trying to understand someone
else's code.

I must be missing something, you have the same problem with pointers,
don't you?

If you see someFn( &x ), how do you know if someFn's prototype is

void someFn( int* ); or
void someFn( const int* );

without looking it up?

In new code, how can you call a function without knowing its prototype?

--
Ian Collins.
May 5 '06 #266
Ian Collins <ia******@hotma il.com> writes:
[snip]
I must be missing something, you have the same problem with pointers,
don't you?

If you see someFn( &x ), how do you know if someFn's prototype is

void someFn( int* ); or
void someFn( const int* );

without looking it up?

In new code, how can you call a function without knowing its prototype?


If you see someFn(x), you can be sure that someFn will not change the
value of x, even without understanding everything about someFn.

In a language with references, or with some sort of pass-by-reference
parameter mechanism, you can't be sure of that.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 5 '06 #267
jacob navia wrote:

The operator overloading change do not affect efficiency at all. One of
the most "dreaded" features of C++ is the problem of avoiding
copy-constructors, constructors and destructors in apparently efficient
and simple statements like

a = *b;
Case 1:

int a;
int *b;

a = *b;

Show me where con/destructors are used.

Case 2:

struct x { int a, int b; };

struct x a;
struct x *b;

a = *b;

Show me where con/destructors are used.

You keep rambling on about this without any solid evidence.
This is not AT ALL my intention. The proposed changes do not affect the
efficency at all, and they are really optional in the sense that the
efficiency loss is only paid by people that use them. In C++ you get
your constructors/destructors whether you want it or not. Operator
overloading is a change that will affect only people that use that
feature. Nobody else has to pay for it.
Twaddle.

In case 2 above, both C and C++ compiler can generate the same code.
The same thing for ALL other changes that are done in lcc-win32:

o overloaded functions: No efficiency lost since the compiler generates
the same machine code as before. This is just compile time changes. But opens up that other can of worms, name mangling and all the
incompatibiliti es that can introduce.
o operator overloading: No efficiency lost for people that do not use
this feature. Some cycles (minimal) of extra cost are there for simple
implementations like the one in lcc-win32. An optimizing compiler
would have no trouble in eliminating it.
o Default arguments: No efficiency loss at all. This is just some
syntatic sugar.

Note that in contrast to C++ C remains NOT object oriented!

None of this realy belongs in C, you can get all these features from C++
without any loss of efficiency.

Ian
--
Ian Collins.
May 5 '06 #268
In article <44************ ***********@tun ews.univie.ac.a t>,
John F <ca************ @gmx.at> wrote:
There is a difference between

(date1+date2 )/2 (adds dates and divides by two)

and

date1+(date2-date1)/2 (proportionally adds the difference between two
dates to another date) The former is meaningless (in a mathematical sense)
That's OK, I understand mathematics, tell me the "mathematic al sense"
in which it's meaningless. Perhaps you could start with a mathematical
definition of "meaningles s", since I've never come across one.
If you argue that adding dates is legal then I suggest you define the
binary operator
What binary operator?
and the division-operator in a serious way. (e.g. it
should tell: What is (March, 13th 2003) / 2? )


It's something which when multiplied by 2 gives you March 13 2003,
and which when added to (March 11 2003) / 2 gives youy March 12 2003.
It is not, of course, a date. There isn't any conventional way to
write it, nor is there a conventional name for its type. But we can
perfectly well define various operations on it.

-- Richard
May 5 '06 #269
Keith Thompson wrote:
Ian Collins <ia******@hotma il.com> writes:
[snip]
I must be missing something, you have the same problem with pointers,
don't you?

If you see someFn( &x ), how do you know if someFn's prototype is

void someFn( int* ); or
void someFn( const int* );

without looking it up?

In new code, how can you call a function without knowing its prototype?

If you see someFn(x), you can be sure that someFn will not change the
value of x, even without understanding everything about someFn.

In a language with references, or with some sort of pass-by-reference
parameter mechanism, you can't be sure of that.

I see your point.

I'd still look at the prototype out of simple curiosity!

--
Ian Collins.
May 5 '06 #270

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

Similar topics

65
5408
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++ language. A C++ interface installation IS ABOUT THE C++ LANGUAGE! The language does not possess the ability to handle even simple file directory manipulation. Those wise people that created it did not take care of it. So, BOOST is a portable...
205
10771
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
17
1906
by: Howard Gardner | last post by:
/* If I am using boost, then how should I write this program? As it sits, this program is using SFINAE to determine whether or not a type supports particular syntax. I suspect that there is functionality in boost to do this. I have found mpl::has_xxx, which I suspect of being part of the solution. I've also found type_traits::has_nothrow_constructor
2
6636
by: smith4894 | last post by:
{ not sure you're aware of that but there are the newsgroups for all major operating systems. you might want to try asking in the forum 'comp.os.linux.development.apps', since memory-mapped files are not a language-supported structure, they are platform-specific. -mod } I'm trying to use boost serialization to serialize/deserialize data to and from a mmap'd file. I have my own ostream/istream classes that essentially read/write bytes...
5
2400
by: linyanhung | last post by:
I used a boost multi thread in VS 2005 on a Duo Core PC, and made a two thread process. The code is something like this: #include <boost/thread/thread.hpp> void fun1() { //do something
8
6216
by: Matt England | last post by:
My team currently using Boost Threads, but we are considering switching to ZThreads. (We seek cross-platform, C++ multithreading capabilities in an external library.) ZThread(s): http://zthread.sourceforge.net/ http://www.inf.uni-konstanz.de/dbis/members/vinnik/zsim/doc/ Can anyone share their ZThreads experience, either good, bad, or
2
2417
by: ironpingwin | last post by:
Hi! I'd like to make few threads which will run in the same time in C++. I try to use boost library v 1.34.1 (it can't be newest, because I compile on remote machine, which is not administrated by me). In this version there isn't detach() function. How to run functions from two different class in the same time?
13
4542
by: brad | last post by:
Still learning C++. I'm writing some regex using boost. It works great. Only thing is... this code seems slow to me compared to equivelent Perl and Python. I'm sure I'm doing something incorrect. Any tips? #include <boost/regex.hpp> #include <iostream> // g++ numbers.cpp -o numbers -I/usr/local/include/boost-1_35 /usr/local/lib/libboost_regex-gcc41-mt-s.a // g++ numbers.cpp -o numbers.exe
5
3596
by: ameyav | last post by:
Hi All, I am converting some C code into C++ code. The objective is to improve throughput. I have some code written in C which serially parses through a list of files, opens each one of them, processes the data and closes the file. All the files are processed one by one. The obvious performance bottleneck that i could think of is the wasted cpu cycles for file i/o. *My solution* was to spawn multiple threads to do the file i/o. For...
0
9901
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
10684
jinu1996
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...
1
10763
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
10371
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
9517
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5744
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...
1
4563
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
2
4159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3188
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.