vector, hash table, etc. library in C? I am abandoning C++

Discussion in 'C++' started by mneuhaber22@berlin.com, Apr 22, 2006.

  1. Guest

    Hello, I regret to say that C++ sucks big rocks.
    I used it until recently because of its container libraries and for no
    other reason.
    In a nutshell concurrency, interruptions, exceptions are ingredients
    which when mixed according to a C++ recipe produce a disaster.

    Today I searched for a pure C implementations of vector, dictionary,
    and other data structures on the net but the results contained so much
    C++ noise that it's like looking for a needle in a haystack. Can
    anybody please point me to such a true and tried C library?
    Much obliged
    --.
    Markus Neuhaber
    , Apr 22, 2006
    #1
    1. Advertising

  2. Bit byte Guest

    wrote:

    > Hello, I regret to say that C++ sucks big rocks.
    > I used it until recently because of its container libraries and for no
    > other reason.
    > In a nutshell concurrency, interruptions, exceptions are ingredients
    > which when mixed according to a C++ recipe produce a disaster.
    >
    > Today I searched for a pure C implementations of vector, dictionary,
    > and other data structures on the net but the results contained so much
    > C++ noise that it's like looking for a needle in a haystack. Can
    > anybody please point me to such a true and tried C library?
    > Much obliged
    > --.
    > Markus Neuhaber
    >


    I don't think the reasons you gave for abandoning C++ are valid. But
    hey, its your choice. I tend to use both C and C++ - it depends pretty
    much on what you're doing, how much of the language you're using you
    know, and any legacy stuff or other restrictions that may be placed on you.

    Have a look at this: http://softwaresensation.com/memsl/

    I think it has all the containers you will need for most purposes :

    # Single, Double, and Circular Linked Lists
    # AVL Balanced and Threaded Binary Trees
    # Dynamic Hashing Tables
    # Stacks, Queues and Dequeues (using arrays or linked lists)
    # Sets (Pascal implementation, with union, difference, intersection, etc.)
    # Bags, Tables and Dictionaries
    # Priority Heaps (uses the MemSL multi-dimensional array allocator)
    # Priority Search Queue


    It is a C library (C++ wrapper classes also available) - It has been in
    use for more than 10yrs (so their docu says) and it is open source (you
    may want to double check on the licensing if you're doing anything
    commercial though - the docu has some pretty scary/terse legal
    sections), although their website says its opensource...

    Enjoy.
    Bit byte, Apr 22, 2006
    #2
    1. Advertising

  3. Guest

    wrote:
    > Hello, I regret to say that C++ sucks big rocks.
    > I used it until recently because of its container libraries and for no
    > other reason.
    > In a nutshell concurrency, interruptions, exceptions are ingredients
    > which when mixed according to a C++ recipe produce a disaster.


    Out of curiosity, can you please elaborate on some of the problems you
    are having. In my firm, we use C++ to take advantage of concurrency,
    and sometimes exceptions. While I don't program with interrupts, they
    are certainly supported to varying degrees depending on your OS and
    runtime implementation (the same is true of C).
    , Apr 22, 2006
    #3
  4. On 22 Apr 2006 06:09:24 -0700, ""
    <> wrote:
    >Hello, I regret to say that C++ sucks big rocks.


    Sometimes yes, mostly no.

    >I used it until recently because of its container libraries and for no
    >other reason.
    >In a nutshell concurrency, interruptions, exceptions are ingredients
    >which when mixed according to a C++ recipe produce a disaster.
    >Today I searched for a pure C implementations of vector, dictionary,
    >and other data structures on the net but the results contained so much
    >C++ noise that it's like looking for a needle in a haystack. Can
    >anybody please point me to such a true and tried C library?


    One 'tried' C library is GLib: http://www.gtk.org/api/
    You may also try some 'untried' libraries like:
    http://freshmeat.net/projects/libcfl/?topic_id=809
    http://www.ioplex.com/~miallen/libmba/
    http://libtc.sourceforge.net/

    Disclaimer: Haven't used those libraries and cannot recommend them
    therefore.

    Good luck,
    Roland Pibinger
    Roland Pibinger, Apr 22, 2006
    #4
  5. REH Guest

    <> wrote in message
    news:...
    > Hello, I regret to say that C++ sucks big rocks.
    > I used it until recently because of its container libraries and for no
    > other reason.
    > In a nutshell concurrency, interruptions, exceptions are ingredients
    > which when mixed according to a C++ recipe produce a disaster.
    >
    > Today I searched for a pure C implementations of vector, dictionary,
    > and other data structures on the net but the results contained so much
    > C++ noise that it's like looking for a needle in a haystack. Can
    > anybody please point me to such a true and tried C library?
    > Much obliged
    > --.
    > Markus Neuhaber
    >


    You are most likely trolling, but I'll bite. I've been using C++ for years
    to build real-time embedded systems and have never had any "disastrous"
    problems involving any of the facilities you listed. For that matter, I've
    also used Ada for years which has concurrency, interrupt handling, and
    exceptions all built into the language without any issues. So, I guess the
    problem must be you and not the combination of these features.

    REH
    REH, Apr 22, 2006
    #5
  6. Guest

    Have you followed discussions on the pthread-c++ mailing list?
    After reading them for some time would you feel comfortable writing
    complex threaded programs in c++? I wouldn't.
    pthreads are but 1 example, the same is true of the boost thread
    facilities, etc...
    I don't want to deal with this junk any more. I've wasted enough time
    scratching my head how to achieve correctness.
    It seems that for most of the c++ proponents here 50% correctness is
    good enough.
    Go right ahead - ship it!
    , Apr 22, 2006
    #6
  7. Guest

    wrote:
    > Have you followed discussions on the pthread-c++ mailing list?
    > After reading them for some time would you feel comfortable writing
    > complex threaded programs in c++? I wouldn't.
    > pthreads are but 1 example, the same is true of the boost thread
    > facilities, etc...
    > I don't want to deal with this junk any more. I've wasted enough time
    > scratching my head how to achieve correctness.
    > It seems that for most of the c++ proponents here 50% correctness is
    > good enough.
    > Go right ahead - ship it!


    You just need to work with someone who knows what they are doing. Most
    people don't know what they are doing, and I think most of the people
    who do don't contribute to USENET. Even so, there's no magic involved
    in solving these problems. Take concurrency, for example. Just putting
    C++ wrappers around the implementatoins in Butenhof would get you most
    of the way there.
    , Apr 22, 2006
    #7
  8. Guest

    My point exactly - they will get me most of the way but not ALL the
    way.
    In other words if the program stays up 95% of the time, that's great.
    Just catch GPF's and restart program the remaining 5% of the time.
    That's the c++ way.
    Unless you can show I am mistaken there is no solution for the
    challenges that interruptions present as of yet.
    Good bye and I thank those who pointed me to C libraries including
    glib, they look promising.
    , Apr 22, 2006
    #8
  9. loufoque Guest

    wrote :

    > Have you followed discussions on the pthread-c++ mailing list?


    Why are you even using pthread in C++ ? It is well known that pthread
    isn't suitable for C++. See
    http://open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1940.pdf

    C++ has better alternatives for multithreading (like boost.thread, as
    you mentioned - but that is still but an attempt to bring multithreading
    to C++), and anyway multithreading is overrated : I've found it to be
    mostly useless in C++, where you can simply write code asynchronously
    within a single thread.


    > I don't want to deal with this junk any more. I've wasted enough time
    > scratching my head how to achieve correctness.


    Please don't insult the language.
    If you don't have enough skill to attain satisfying correctness in C++,
    that's your problem.
    A lot of people think C++ is pretty good. Yes, we know it's a little
    tricky or even annoying sometimes, but it has some good counterparts.

    Anyway I don't see how C is better.
    It's way more annoying to me, as it's basically the same as C++ without
    the abstraction possibilities.

    For a container library in C I would advise glib as it is the only one I
    ever used.
    It may be a little big though, as it contains quite some stuff.
    loufoque, Apr 22, 2006
    #9
  10. Guest

    loufoque wrote:
    > wrote :
    >
    > > Have you followed discussions on the pthread-c++ mailing list?

    >
    > Why are you even using pthread in C++ ? It is well known that pthread
    > isn't suitable for C++. See
    > http://open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1940.pdf
    >
    > C++ has better alternatives for multithreading (like boost.thread, as
    > you mentioned - but that is still but an attempt to bring multithreading
    > to C++), and anyway multithreading is overrated : I've found it to be
    > mostly useless in C++, where you can simply write code asynchronously
    > within a single thread.


    This doesn't make any sense. You need multithreading if you want to do
    parallel processing in the same executable. How can you achieve
    parallel processing with one thread?
    , Apr 22, 2006
    #10
  11. REH Guest

    <> wrote in message
    news:...
    > Have you followed discussions on the pthread-c++ mailing list?
    > After reading them for some time would you feel comfortable writing
    > complex threaded programs in c++? I wouldn't.
    > pthreads are but 1 example, the same is true of the boost thread
    > facilities, etc...
    > I don't want to deal with this junk any more. I've wasted enough time
    > scratching my head how to achieve correctness.
    > It seems that for most of the c++ proponents here 50% correctness is
    > good enough.
    > Go right ahead - ship it!
    >


    You need to quote some text so we know to whom and what you are replying.

    REH
    REH, Apr 22, 2006
    #11
  12. REH Guest

    "loufoque" <> wrote in message
    news:444a63b7$0$9458$...
    > wrote :
    >
    > but that is still but an attempt to bring multithreading to C++), and
    > anyway multithreading is overrated : I've found it to be mostly useless in
    > C++, where you can simply write code asynchronously within a single
    > thread.
    >

    Such code is all but worthless in a real-time system with hard deadlines.
    You really need truly independent, prioritized threads of execution. You
    need to be able to deterministically guarantee a thread's time partition.

    REH
    REH, Apr 22, 2006
    #12
  13. Default User Guest

    wrote:

    > Hello, I regret to say that C++ sucks big rocks.


    *plonk*

    This way I won't see your whiny ass over on comp.lang.c, the place you
    should have posted your request (but not the bashing).

    I'm not the only C person who also reads this group, so your ridiculous
    behavior likely won't help with them either.



    Brian

    --
    If televison's a babysitter, the Internet is a drunk librarian who
    won't shut up.
    -- Dorothy Gambrell (http://catandgirl.com)
    Default User, Apr 22, 2006
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Philipp Schumann

    Why do my sessions keep abandoning??

    Philipp Schumann, Apr 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    330
    Rick Strahl [MVP]
    Apr 18, 2004
  2. dotnetforfood
    Replies:
    3
    Views:
    338
    dotnetforfood
    Jul 4, 2004
  3. Replies:
    8
    Views:
    1,912
    Csaba
    Feb 18, 2006
  4. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    383
    Fredrik Lundh
    Aug 13, 2008
  5. rp
    Replies:
    1
    Views:
    512
    red floyd
    Nov 10, 2011
Loading...

Share This Page