473,839 Members | 1,485 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 11904
CBFalconer <cb********@yah oo.com> wrote:
1. Much less time spent evaluating dozens of third party libraries.


What evaluation? You do it once. You can also evaluate the
source.


Even once can involve a lot of overhead if you need a few dozen
libraries and there are 3 or 4 competitors in each area. Take a look
at the sometimes obscene dependencies list on non-trivial projects.

Having the source available is always an advantage.
2. Much less time spent ensuring legal compliance with dozens of third
party libraries.


If you operate under GPL what compliance problems? If you want
something for nothing and also want to absorb it, that's another
matter.


Operating under the GPL is often not an option. In addition,
sometimes the solution you've chosen is not available under the GPL.
3. Much less time spent keeping third party libraries updated (when
new features became available that we wanted to leverage or exploits
in older versions were discovered).


What updates? If things are written in standard C they won't need
updating, apart from insects. The older the source files dates the
better (up to a point).


If you're linking in a few dozen libraries, I should hope you're
keeping abreast of updates to see if newer versions fix exploits.
4. Many fewer cross platform issues.


Once again, use standard C. Virtually eliminates platform issues.


It's possible to write extremely portable C code. It can also be an
extremely non-trivial exercise.
May 6 '06 #291
Ed Jensen a écrit :
[snip]
It's possible to write extremely portable C code. It can also be an
extremely non-trivial exercise.


Portable C will never have the speed of fine tuned assembler/optimized
libraries that have been written by the compiler system writers and use
each advantage for the specific platform they are writing to.

If you want to remain portable, you can't use any speedups, shortcuts or
system specific stuff by definition.

The advantage of language wide libraries like the C library is that the
compiler vendors can optimize it for each platform, underneath a common
interface visible by the library user.

jacob
May 6 '06 #292
CBFalconer wrote:
we******@gmail. com wrote:
Ian Collins wrote:

... snip ...
That's one of the things that hurts C, think how much more
productive those programmers would be if they didn't have to
write their own string library.


I don't know if you are being sarcastic or not. Certainly C
programmers would be more productive if they were not wasting
time debugging buffer overflows. I think C is the only language
or mechanism which has hundreds CERT advisories for the exact
same bug. C programmers might be more productive if they didn't
need to reroll a hash table, or vector or myriad of other data
structures that come prepackaged in other languages (and debug
them) as well.


Well, I can't remember debugging a buffer overflow in my own code.
I do regularly use the standard string package.


And therefore there are no CERT advisories related to buffer overflows
when using C string functions. Right? Wow -- pure genius, you just
solved far and away the biggest software security problem in existence
(by a ridiculous margin) with mere force of your eloquent disposition.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 7 '06 #293
CBFalconer wrote:
Ed Jensen wrote:
CBFalconer <cb********@yah oo.com> wrote:
That all depends on the license under which the source code was
released. Linking a bunch of C libraries under various licenses can
involve non-trivial amounts of legal hassle to ensure compliance.

If you publish your source under GPL, there is very little chance
of conflicts. In the case of things I have originated, all you
have to do is contact me to negotiate other licenses. I can be
fairly reasonable on months with a 'R' in them.
Many years ago, I helped write a moderately large project in C. More
recently, I helped rewrite the project in Java. Due to the standard
Java library, here are some of the advantages I encountered:

1. Much less time spent evaluating dozens of third party libraries.


What evaluation? You do it once. You can also evaluate the
source.


What exactly do you think he's talking about? There is a lot of
unusuable crap out there, and you have to examine things seriously
before you use them. You end up evaluating everything you use as well
as everything you consider to be a candidate but do not use.
2. Much less time spent ensuring legal compliance with dozens of third
party libraries.


If you operate under GPL what compliance problems? If you want
something for nothing and also want to absorb it, that's another
matter.


Tell that to Microsoft, SCO or other proprietary vendors. BSD and MIT
tend to be far more compatible licenses. You only use the GPL if you
are supporting the FSF adgenda -- i.e., if you intentionally want to
keep proprietary vendors from using your code (even if they make a
widely deployed C compiler).
3. Much less time spent keeping third party libraries updated (when
new features became available that we wanted to leverage or exploits
in older versions were discovered).


What updates? If things are written in standard C they won't need
updating, apart from insects. The older the source files dates the
better (up to a point).


You write bug free, scalable code that never needs to be updated? Oh
wait, I *know* you don't do that -- perhaps its some code you don't
publish on your website that we never get to see that is written to
such perfection.

The truth is that for all serious non-trivial libraries, you have to
make provisions for periodic updates. And C libraries are worse
because there is a much higher probability of being bitten by a flaw of
catastrophic proportions. The standard JPEG library flaw, that allowed
people to arbitrarily take over client machines remotely by hosting
specially constructed exploit images is merely the latest in classic
examples of this.
4. Many fewer cross platform issues.


Once again, use standard C. Virtually eliminates platform issues.


Use any other modern language and it does a better job at eliminating
platform issues.
If you want a specialized library for the DeathStation when fitted
with three Mark XVII missiles, then you should probably resign
yourself to writing it for yourself.


This problem of dealing with control of WMDs is something completely
different -- it affects more people that the people creating them. In
that event you throw money at the problem, by paying for review, not
operating on deadlines set by marketing and you program them in serious
and verifiable languages like Ada.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

May 7 '06 #294
"Ian Collins" <ia******@hotma il.com> wrote

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?

If the function takes a pointer to a single integer it must either change
that integer, sometimes change the integer, or sometimes go through versions
which change the integer. Otherwise the author would have written it to take
an int.
(The unfortunate exception is functions which are written in Fortran but
called from C. Fortran takes all arguments as pointer.)

When x is an array, there is a problem. With hindsight K and R should have
incuded some sort of syntactical marker, such as puting writable arguments
in <> brackets, to mark arrays as writeable. It is too late now.

--
www.personal.leeds.ac.uk/~bgy1mm
Programming goodies.
May 7 '06 #295
Malcolm wrote:
"Ian Collins" <ia******@hotma il.com> wrote
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?


If the function takes a pointer to a single integer it must either change
that integer, sometimes change the integer, or sometimes go through versions
which change the integer. Otherwise the author would have written it to take
an int.


OK, int was a bad choice, replace it with someStruct and the argument is
more compelling.

--
Ian Collins.
May 7 '06 #296
"Richard Tobin" wrote:
John F <ca************ @gmx.at> wrote:
There is a difference between

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

and

date1+(date 2-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.


It's no longer a date. So you are no longer within the same set. You
leave the domain, which is not acceptable and thus not meaningful for
an inner binary operator as the usual addition is.
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.


Sure we can. But here you agree that the result is meaningless in the
sense of being a date (thus not staying within the domain). You may
define an outer binary operator.

--
regards
John
May 7 '06 #297
"Keith Thompson" wrote:
"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.


Thanks for clarification. I was referring to the math behind it where
it yealds an error in the domain ot the binary operator +...
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.
Exactly. At least if you assume the same base for the representation,
and the same scale for the offset too.
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.
Exactly. You can't tell what it should be. Same applies as above. Same
scale for the offset and a common base can be found to set the base_x
values. Which should be quite hard for a time-scale. One can always go
back and back... With temperature a natural limit showed up with
absolute zero.

Have you ever tried to translate a chinese date into the gregorian
calendar? It is really nice.
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.
Again assuming a common base and the same scale for the offset. (just
to remind :-)
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.
Agreed.
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.
I don't want to do that. Really. Avoiding objects where intermediate
results can't be illegal as a whole would fix 80% of all bugs, I
guess.
Second, it makes
it difficult to define the circumstances in which overflow can
occur.
Yes.
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.
Exactly. It would be hard to implement too.
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 */
At least with weak checking. One could argue that we could define a
type

"SOD" (Sum of dates" and you would need to make this type illegal for
an lvalue.

the "2" in the expression
x=(date1 + date2)/2 should get type "DD" (DateDevider)

and [SOD]/[DD] = [D] such that x would get type D again. It is a lot
of brainy stuff, but should work. (never seen a language with such a
feature (except VB with its "Variant", where almost every operation
yealds a meaningful result (regarding the type)))

I'd rather have a function x = mediandate( date1, date2 ); for that
job.
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.
Using the natural division: char for day, char for month, long long
for year and double for the seconds within a day it shouldn't be any
problem. It is all a matter of promotion :-)
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;


One should add: for ptr2 >= ptr1.
(never seen a negative pointer in C)

(sorry for the long post, thanks for reading up till here)

--
regards
John
May 7 '06 #298
"Malcolm" <re*******@btin ternet.com> writes:
"Ian Collins" <ia******@hotma il.com> wrote

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?

If the function takes a pointer to a single integer it must either change
that integer, sometimes change the integer, or sometimes go through versions
which change the integer. Otherwise the author would have written it to take
an int.
(The unfortunate exception is functions which are written in Fortran but
called from C. Fortran takes all arguments as pointer.)

When x is an array, there is a problem. With hindsight K and R should have
incuded some sort of syntactical marker, such as puting writable arguments
in <> brackets, to mark arrays as writeable. It is too late now.


You can't have a parameter of array type in C. This:
void foo(int x[]);
is precisely equivalent to this:
void foo(int *x);

In my opinion it would have been better to drop the [] syntax for
parameters, and require them to be written as the pointers they really
are.

Either that, or somehow make arrays first-class objects and actually
support passing them as parameters.

C99 adds some new syntax for array parameters, which complicates the
discussion -- but it is, as you say, too late now.

--
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 8 '06 #299
CBFalconer <cb********@yah oo.com> wrote:
Walter Roberson wrote:
CBFalconer <cb********@mai neline.net> wrote:
For example, a future standard could restrict 'precedence' to three
levels (e.g. logical, additive, and multiplicative) only, requiring
parentheses for any further control, yet allowing the actions of
the present silly system.


People might possibly grudgingly accept needing parens for
~ and !, but there is a long history of unary minus in indicating the
sign of constants and I'm not sure how happy people would be with
needing parens around every negative number.


The unary minus is a chimera. C does not parse these things in
that form. The action of "-32768" is to apply a negation to the
positive integer 32768.


That is precisely Walter's point. Under your restricted precedence
rules, -32768 would have to be written as -(32768) (and in most contexts
as (-(32768)) ), since unary minus is not a logical, additive or
multiplicative operator. (In particular, despite appearances it is not
the additive minus operator, since it must have a different precedence
in expressions such as -3*4, which is (-3)*4, not -(3*4).)

Richard
May 8 '06 #300

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

Similar topics

65
5406
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
10760
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
1902
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
6214
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
4541
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
9854
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
9696
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
10584
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
10645
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
7827
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
5865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4482
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
4063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3131
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.