I
Ian Collins
Ian Collins a écrit :
Yes, that has been corrected, see the changelog
No, it hasn't, the definition of getline is still missing.
Ian Collins a écrit :
Yes, that has been corrected, see the changelog
Dag-Erling Smørgrav said:So because C++ has containers, iterators and algorithms, we should not
use data structures, for loops or in fact anything that has any
observable effect on the state of the program?
Francis said:OK, I get it. You hate the idea.
Many things have already been done in
C++. OTOH there are many places where C++ cannot be used for a variety
of reasons. Some of these places have uses for containers and writing
a container from scratch is a non-trivial task.
By all means critique someone's code but the above is not that, it is
just a very negative criticism.
If 'it has been done before elswhere'
were a reason for not doing something there is not much that most
people could do.
ImpalerCore said:Any new container library is going to be compared against what is
already available. This kind of criticism is to be expected.
In general I feel almost impossible. I think it's possible to
introduce a framework that gets collective support from some portion
of the C community (like GLib), but even hoping for that is quite a
long shot and would require an extraordinary amount of work.
The
people who were actively working in container research passed C by a
long time ago, and without the prudent thinking of C++ proponents in
the early going before it was standardized, C++ may have missed the
STL and ended up with a similar situation to C; a multitude of vendor
driven container libraries.
Can you explain what you mean by going awry in your context?
No, but it's fun to rehash the argument with new attempts (I'm a
relative newcomer to clc). And it beats the usual spam that gets
posted. It got you to post didn't it ;-)
I also have an interest in generic containers in C, but I don't have
nearly the amount of ambition as Navia has.
While I believe that you will not achieve STL like capability with
template support, I do believe that there is potential; perhaps that's
me being young and foolish though ;-). The main drawback contrast
with C++ is that the C container interface will have to carry the type
around, whether manual casting and sizeof's, or wrapping the interface
with macros. It puts a larger burden on the programmer, but that's
what you get for using C.
I think that PREFERRED is too strong. I'm sure that most people here
think that the concept of a standardized C container library is "a
good thing". I also think that the container library should conform
to the language standard, and not the other way around. Getting
enough people to agreeing on what that library looks like though may
infer that no one could propose a library that could be universally
agreed to be considered the "C standard container library".
I agree. The best that I think any aspiring C container library would
be is some kind of Boost like use. At the moment, I feel that someone
trying to get a C container library standardized borders on delusions
of grandeur. 30+ years of C and people much smarter than me and still
no standard C container library leaves me with no confidence that it
can be done. However, I enjoy arguing about it on clc.
There should be more than one, and there are. Should there be a
ISO-blessed one, I guess it can't hurt (well it does hurt those in the
business of selling such libraries and it does stagnate evolution of such
things, so maybe it does/did hurt). The STL is so general that it mostly
appeals to, well I don't know whom. Those enamoured with PLs and those
with very large project budgets for sure.
I have been talking about this [a container library for C]
since quite a long time.I'm not sure I agree his criticism is entirely negative.
It wasn't AT ALL NEGATIVE.
?
There are
some things that are just not worth doing. Writing a compiler in
COBOL.On the other hand I'm not sure a container library in C is entirely
mad.
And thousands have already done it. So this 10000th time, this one is
going to become a standard? What are the chances? I don't think you can
introduce a construct with "->VTable" in it and appeal to a major portion
of a C audience. There are many things like that in the document he
offered up above which indicates to me that he is quite disillusioned
about the whole concept
of A.) What level of effort and knowledge
creating such a library entails,
and B.) What level of evolved quality
such a library would have to attain before being worthy of presentation
to a standards organization, and C.) The "spirit of C" and how to market
to a larger segment of the C user base. To say "here is my ad hoc
container library" is quite different from saying "here is my proposal
for a container library to be in the next C standard".
Not that I'm knocking it. It's just fun to analyze projects and why they
go awry.
Oh. Did any conclusions come out of that back then?
I was wondering if he knows the "other" language.
Or any other other such
libraries for that matter since his approach seems to be that which has
been rejected eons ago (1993?) by container library developers.
"few" being the keyword (NPI)? Knowing that it will take years to evolve
such a library, one must consider the relevence of C and the "need" for
such a libray for when it would actually become useful (years from now,
and if it's just one guy doing the development 5 years at least and many
complete overhauls of the architecture).
1.) I don't see the it happening without support from the language
proper. 2.) If the language proper is changed to accomodate elegant
implementation, then it's basically on the path of C++, so when does it
stop?
When it becomes a C++ but only slightly different? Maybe THAT is
why there are so many libraries in C: the language doesn't have the
supporting mechanisms to allow an elegant implementation that anyone
would want to label as "The Standard C Container Library", so ad-hoc
implementation is actually PREFERRED. Not meaning "write your own",
(though you can), but rather obtain one that is already evolved.
So, just my .02, but I think container libraries for C are outside the
domain of the standard that is C and has been long ago decidedly
relegated to individual developers (companies). Finally, I DO think C
evolution has stopped long ago also and that it is in maintenance mode as
far as the standard goes.
There should be more than one, and there are. Should there be a
ISO-blessed one, I guess it can't hurt (well it does hurt those in the
business of selling such libraries and it does stagnate evolution of such
things, so maybe it does/did hurt). The STL is so general that it mostly
appeals to, well I don't know whom.
everyone?
Those enamoured with PLs
and those
with very large project budgets for sure.
[...] The best that I think any aspiring C container library would
be is some kind of Boost like use. At the moment, I feel that someone
trying to get a C container library standardized borders on delusions
of grandeur. 30+ years of C and people much smarter than me and still
no standard C container library leaves me with no confidence that it
can be done.
I actually tried that, back when I was young and foolish!
I thought that too. In technical terms the performance is a s good asstd::vector and std::string seem eminantly usable even in small
programs. What's wrong with the STL? I always thought it was one of C+
+s selling points!
I thought that too. In technical terms the performance is a s good as
C structures, and the templated classes are more flexible.
There are two problems.
There's no way of writing a function that accepts a list and having a
reasonable chance that the interface will be accepted, understood, and
convenient for everybody.
The syntax is just a step too far.
void foo( std::list said:I think the STL has in fact played a major role intaking down C++,
simply because of these two facts.
A "list" is an ordered series of data items.
Eh?
void foo( std::list<int>& );
Do what?
A "list" is an ordered series of data items.
The generic STL way of taking a list to to take an iterator to the
start and end of the controlled sequence. The problem is that this
mechanism is too difficult, counter-intuitive, or whatever for
everyone to use consistently.
TRy declaring some simple data structures with the STL, in a real but
simple program. Then write the same program in C. You'll soon see the
problem with the STL syntax.-
People seem to forget history: some set out to improve C 25 years ago and
it resulted in C++. The question becomes, what compromises is one willing
to make on that duplicate path/journey?
Setting out to Vegas on a whim is not prudent, especially after a night
at the bar. With the studies and justifications and goals and plans
absent, and without a sober state of mind, I see no reason to embark.
Bypassing all the practicalities is not a way get people bought-in to the
idea.
It may even be dishonest.
No, it hasn't, the definition of getline is still missing.
jacob navia said:That function is defined in fgetline.c line 73.
It is used in strcollection.c line 692 and 696.
The prototype is:
int getline(char **LinePointer,
int *n,
FILE *stream,
ContainerMemoryManager *mm);
Prototype in containers.h line 183.
The problem is that you're just adding one more to the thousands ofIt is not evident that the thousands of list libraries, hash table
libraries written in C could benefit by having a standrad way of
making them inter-operable so that you can replace libraries without
pain?
Perhaps you could use a different name to 'getline', since that is
already used in Glibc.
The problem is that you're just adding one more to the thousands of
libraries out there.
this is called "method swizzling" and it's dangerous when applied on
an entire "class".
http://zathras.de/angelweb/blog-method-swizzling-considered-harmful.htm
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.