473,854 Members | 1,531 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 11956
jacob navia wrote:
Richard Heathfield a écrit :
.... snip ...

Nobody is stopping you. Why not get on with it? For example: what
containers do you think a standard C container library should
make available?

.... snip ...
The minimum set for containers would be:

Lists
Flexible arrays
Hashtables
What should the APIs look like?


We have the common verbs like Create, Add, Delete, Find, etc. The
same verbs should be used in all of them, if possible and if it
makes sense.


For some time there has been a solid and flexible hashtable
implementation available, under GPL. I wrote it, in purely
standard C, thus it is portable anywhere. I have heard no
bug-reports (after a very early one to do with a minor memory leak,
fixed). It is, and has been, freely accessible to all. You have
permission to use it, under the GPL of course.

<http://cbfalconer.home .att.net/download/hashlib.zip>

Incidentally, the API was developed via some discussions on this
very newsgroup. The system uses no wierd special provisions, such
as garbage collection, overloading, etc. It also imposes no
restrictions as to the kinds of data manipulated. At the same time
the code is fully re-entrant.

While I have to admit to some bias, I consider it a good example of
a C library module. Unlike lcc-win32, the source code is out there
and available for all to peruse and criticize.

--
"If you want to post a followup via groups.google.c om, 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/googlegroupsrep ly/>
May 2 '06 #151
Robert Latest a écrit :
On 2006-04-30, jacob navia <ja***@jacob.re mcomp.fr> wrote:

We had this discussion already. I started yet another discussion about
the need for a portable standard container library several times and the
answers were:

[ quotes of clc regulars saying that such a library is
unnecessary snipped ... ]

And everyone accepted those things in silence. Nobody complained.

Which you failed to take as a pretty strong hint to the fact that
the regulars might be right, and you might be wrong.


Of course the "regulars" are right. C should be kept as dead as
possible. This is of course RIGHT since you say that C++ is the best
thing in the world. There is no point in dveloping C. C++ has done it
already.

That's YOUR point of view, I disagree.

The standards comitee doesn't even accept simple data structures like
strings. Lists, flexible arrays, stacks, queues, etc etc must be done
over and over, and are kept OUTSIDE the standard library.

Why?

Why not? This way the language itself is kept lean and simple,


Lean and simple?

Assembler is even leaner and is much simpler.
and those that need more complex stuff can choose from a host of
good libraries that do what they want. GLib comes to mind as an
example.


Yes, that is precisely the point: " a HOST of good libraries" all of
them incompatible with each other and none part of a standard. The same
argument could be used in C++ AGAINST the STL, that you advocate in
another message.

Why is that good for C++ but not good for C?

I repeat that such an attitude towards data structures means that indeed
C is the past and C++ the dreaded future.

And who cares?


I do

Why the fuzz?

Because I do not want that to happen.

Why are you wasting your time in a Usenet group about a soon-to-be-dead
language anyway?

The same reasons than you probably.
Usenet is there to allow people interchange ideas, proposals, ways of
working, etc
May 2 '06 #152
Ben Pfaff wrote:
jacob navia <ja***@jacob.re mcomp.fr> writes:
Ben Pfaff a icrit :
we******@gmail. com writes:
You are saying you should throw out an entire language because you
don't like the way it handles strings?
It depends on your priorities. I wouldn't want to rewrite a Perl
program that does complex string processing in C. It's going to
get a lot longer and possibly harder to read (depending on how
much taste the Perl programmer had).
You mean then in substance:

"Since C strings are completely screwed up, do NOT try to change that,
but learn Perl".


No. I mean that some string operations can be expressed shorter
and with more clarity in Perl than in C. No new string library will change
this.


That's a pretty wishy washy premise on which to base an implied
disapproval of Bstrlib. Let me just guess that you haven't really
seriously taken a look at it.

Bstrlib + PCRE is virtually functionally equal to Perl. And of course,
since its C, it can support reference based sub-strings, and users have
compile time type safety assistance. If you use the C++ interface
(CBStrings) you will have comparable syntactical brevity to Perl.
If you want to actually change the C language to improve its
string support, as you seem to want, that's completely separate.
But your changes to C won't affect my software for 10 years or
more, because that's at least how long it'll take for them to get
into the standard (assuming they ever do) and then make it into
a wide range of real-world implementations .


Yes, but this criticism applies, at the very least, to the entire C99
standard as well; which is apparently not off topic in this news group.
Except that more likely, there is *no* amount of time that you will be
able to wait to be able to assume C99 compliance in most available C
compilers.

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

May 2 '06 #153
jacob navia said:
Robert Latest a écrit :
On 2006-04-29, jacob navia <ja***@jacob.re mcomp.fr> wrote:

Operator overloading is a well known technique, no need to swallow
all C++ to get it. Thank you

What's so great about operator overloading?

robert


It is a technique for defining new numeric types and new kinds of
operations for numeric types.

This is not possible in standard C.


He didn't ask what it is. He asked what's so great about it. The ability to
define new numeric types is of limited utility. It's good for bignums and
rationals, maybe for complex numbers and quaternions too, but that's about
it, really.

--
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 2 '06 #154
Richard Heathfield a écrit :
jacob navia said:

Robert Latest a écrit :
On 2006-04-29, jacob navia <ja***@jacob.re mcomp.fr> wrote:

Operator overloading is a well known technique, no need to swallow
all C++ to get it. Thank you
What's so great about operator overloading?

robert


It is a technique for defining new numeric types and new kinds of
operations for numeric types.

This is not possible in standard C.

He didn't ask what it is. He asked what's so great about it. The ability to
define new numeric types is of limited utility. It's good for bignums and
rationals, maybe for complex numbers and quaternions too, but that's about
it, really.


A)

Consider that the MMX instruction set is around 10 years old now, and
that we have yet to see a mapping of those operations into C.

A "clamped" add is when you have

unsigned char a,b=200,c=200;

a = b+c;
// now a is 255, no wrap around. Value of addition
// clamped to highest possible value.

Since we can't redefine the operators in C, we would have to go to the
function call syntax (c=clamped_add( a,b)) what makes any using of
existing code impossible.

lcc-win32 provides bignums, qfloats, and other types of numbers easily
with this feature.

This feature could be used in other contexts, for instance in the
implementation of the fixed point features now added to a TR, without
making any new API or incompatible keywords...

B)

This feature is useful when applied to special forms of arrays. Suppose:
typedef struct _String {
size_t length;
char *data;
} String;

If you want to maintain the natural syntax

String s;
....

s[2] = 'e';

it is good to be able to overload the [].

C) Lcc-win32 implements complex numbers using this feature because that
way users can REPLACE the default implementation with their
implementation that could be better suited to their needs. This feature
allows users to replace parts of the library at will.

May 2 '06 #155
In article <sl************ **********@loca lhost.localdoma in>, Robert
Latest <bo*******@yaho o.com> writes

And who cares? Why the fuzz? Why are you wasting your time in a
Usenet group about a soon-to-be-dead language anyway?

robert


Years ago one of my lecturers said:

"COBOL is Dead..... we have buried it EVERY year for the last 20 years!"
:-)
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys. org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

May 2 '06 #156
jacob navia said:
Richard Heathfield a écrit :
jacob navia said:

I want to discuss about improving C strings for
instance, about a container library etc.

Nobody is stopping you. Why not get on with it? For example: what
containers do you think a standard C container library should make
available?


What we should agree is a common interface for all containers, and
prescribe a few minimal ones.


Getting that agreement is a good 99.99% of the problem.
A common interface means that all containers have the same method (i.e.
function name, arguments) for accessing it, adding to it, deleteing from
it, etc.
See below.
This allows the user to switch easily from one container (say a list) to
another (say a table) without too much rewriting of code.

The minimum set for containers would be:

Lists
Flexible arrays
Hashtables
Presumably you would view a string as a slightly specialised form of
flexible array.

What about DAGs? Shouldn't they get a look-in? Lots of people want trees,
you know.
What should the APIs look like?


We have the common verbs like Create, Add, Delete, Find, etc. The same
verbs should be used in all of them, if possible and if it makes sense.


The names are important, it's true, but the parameter lists are of rather
more concern, are they not? And, of course, the return types.
I have several months ago proposed an interface for containers where we
use extensible function tables. In this manner we would keep the
interface flexible enough.


These sound a lot like vtables to me. Yes, we could indeed change C into
C++. But wouldn't it be much quicker and less effort just to call strcat(c,
"++")?
And how will you persuade people to use the new
library instead of whatever they are using right now?


If this library is accepted by the standards comitee it would be added
to the language.


<shrug type="stuff in the C language that I never bother to use">
restrict
// comments
VLAs
complex numbers
flexible array members
compound literals
static qualifiers in parameter array declarations
type-generic math macros
long long int
designated initialisers
extended integer types
block scopes for selection and iteration
variable argument macros
vscanf
trailing commas in enums
%lf in printf
inline functions
snprintf
boolean type
empty macro args
_Pragma
VA_COPY
</shrug>
.......and no doubt much, much more.

Chuck the new containers onto the list - unless you can demonstrate some
real world advantage of the new container library that will persuade a
large proportion of the C community to abandon the stuff they:

* are already using;
* are already familiar with;
* have already ported to all the places they feel necessary.

An Oracle programmer (a very good one, I hasten to add) once told me of a
chap who came to his place of work in the early 1990s, attempting to
persuade them to convert from C to C++. The poor chap spent an hour or so
presenting an object-oriented database methodology to the Oracle guys. He'd
obviously worked very hard on it. As he was winding up his presentation and
heading rapidly towards "are there any questions?", he suddenly noticed
that just about everybody in the room was regarding him with utter
astonishment. He panicked, and said "What's the matter? Have I got
something wrong?" Came the reply, "No, no, maybe one or two bits could be
improved here or there... it's broadly okay though... but - we did all this
*years* ago! And you want us to write it *again*?"

I don't know whether the experience made him a wiser man, but he was
certainly better-informed.

I see no benefit to changing working code to use these hypothetical new
container libraries. If it ain't broke, don't fix it.

For new code - sure, why not, provided you can persuade people that the new
libs actually work properly, and are widely available. Six and a half years
on from the introduction of C99, I still can't use its new features because
they still aren't sufficiently widely available that I can send source code
to a complete stranger whom I know only to have an implementation claiming
to support "ANSI C"[1], and be able to *guarantee* that his implementation
will be able to understand C99 features.

I have asked these questions before. You seem reluctant to pursue them.


Yes, because in this polemic situation it is difficult to discuss
matters with the necessary objectivity. I am not saying I know all the
answers and this is quite difficult. It is made even more difficult if
there is an hostile atmosphere around.


There would be less hostility, I suspect, if you didn't keep dumping lcc
extensions into your replies as if they were somehow magically topical
here.

[1] Please remember that the introduction of C99 did not magically change
the documentation of all existing implementations . The documentation for
Turbo C 2.01 still claims that it is an ANSI C compiler, even though ANSI C
has moved on and Turbo C 2.01 has not. It is not unreasonable for people to
expect to be able to compile ANSI C programs in Turbo C 2.01.
--
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 2 '06 #157
jacob navia said:
A)

Consider that the MMX instruction set is around 10 years old now, and
that we have yet to see a mapping of those operations into C.
Consider that many computers don't /have/ the MMX instruction set. What
possible use could C mappings of MMX instructions be to a mainframe
programmer?
B)

This feature is useful when applied to special forms of arrays. Suppose:
typedef struct _String {
size_t length;
char *data;
} String;

If you want to maintain the natural syntax

String s;
...

s[2] = 'e';

it is good to be able to overload the [].
That's arguable. Some might consider it good. Others might consider it
unnecessarily confusing. [] suggests that s is an array, which it clearly
is not.
C) This feature
allows users to replace parts of the library at will.


Making the code harder to read, harder to understand, and harder to
maintain. If people aren't even going to /use/ the library, why bother
writing 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 2 '06 #158
Richard Heathfield a écrit :
jacob navia said:

A)

Consider that the MMX instruction set is around 10 years old now, and
that we have yet to see a mapping of those operations into C.

Consider that many computers don't /have/ the MMX instruction set. What
possible use could C mappings of MMX instructions be to a mainframe
programmer?


Exactly. That is why you would use operator overloading in computers
that have the MMX instruction set (PCs) and not use any operator
overloading for those operations in computers that do NOT have that feature.

Compare this solution with other solutions where the language would add
a special |+ operation (or similar) to the language itself.

All implementations would have to use it.

The advantage of operator overloading here is PRECISELY that you do it
where it is needed and nowhere else!

The language is made extensible without adding any specific extension.
B)

This feature is useful when applied to special forms of arrays. Suppose:
typedef struct _String {
size_t length;
char *data;
} String;

If you want to maintain the natural syntax

String s;
...

s[2] = 'e';

it is good to be able to overload the [].

That's arguable. Some might consider it good. Others might consider it
unnecessarily confusing. [] suggests that s is an array, which it clearly
is not.


Excuse me, it IS an array, but indexed with an size_t offset from the
beginning that is all.
C) This feature
allows users to replace parts of the library at will.

Making the code harder to read, harder to understand, and harder to
maintain. If people aren't even going to /use/ the library, why bother
writing it?


Why is this:

SomeIntType_t a,b=7,c=6;
a = b*c;

more *difficult* to read than

SomeIntType_t a,b,c;

intToSomeIntTyp e(&b,7);
intToSomeIntTyp e(&c,6);
SomeIntType_Add (&c,b,a);

?????????
May 2 '06 #159
jacob navia <ja***@jacob.re mcomp.fr> wrote:
Richard Heathfield a écrit :
jacob navia said:
B)

This feature is useful when applied to special forms of arrays. Suppose:
typedef struct _String {
size_t length;
char *data;
} String;

If you want to maintain the natural syntax

String s;
...

s[2] = 'e';

it is good to be able to overload the [].


That's arguable. Some might consider it good. Others might consider it
unnecessarily confusing. [] suggests that s is an array, which it clearly
is not.


Excuse me, it IS an array, but indexed with an size_t offset from the
beginning that is all.


No, it is not. It is a struct.

s[2]='e' means that *(s+2) must now == 'e'. Is that true for your
struct? If so, how do I get a pointer to its first member? Is offsetof
not broken?

If you consider a feature which demands all those questions "natural",
you must live in the centre of a big city, and think milk comes from a
factory.

Richard
May 2 '06 #160

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
1905
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
9751
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
11027
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...
0
10682
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...
0
9513
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...
1
7917
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
7082
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
5942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.

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.