BCL for native C++ - possible?

Discussion in 'C++' started by Andreas Schmitt, May 17, 2007.

  1. Crazy idea but...

    I think everyone could agree with the statement that the CLI standard
    Base Class Library is incredibly useful, not to mention the extentions
    by microsoft and managed directX and several other stuff that builds on
    top of the BCL.

    Now.. do you think it would be possible to port the BCL to C++?

    Meaning starting with an object class all other classes have to inherit
    from, building structs (value classes) around the native types, giving
    them the same nice methods as in .net.
    Disallowing ref types to be created on the stack (one might think of
    declaring the destructor protected and make every smart pointer a
    friend, handling smart pointers like the handles in C++/CLI)

    Of course some stuff should be conventions then, like always inherit
    from Object, and always use smart pointers / handles to instantiate ref
    types and so on...

    Then on that basis implement the entire BCL for C++ as a class library.

    It is very much bigger than the STL but the STL is perfect as a basis
    for the implementation... and the Class library could be a basis to
    build on top of.
    I think much of the productivity of .NET is caused by the enormeous help
    the BCL is offering and secondly by the garbage collector.

    I think one could reach a similar level on native C++ if having the same
    classes available together with the upcoming GC for C++0x.
    Memory leaks should not pose a problem anymore if all classes force you
    to not instatiate them with a simple pointer but always either using a
    smart pointer or with C++0x the native garbage collector.


    As I said, crazy idea, especially considering how huge the BCL is, even
    without all the useful extentions for it around...

    but just as a question.. would this make sense, do you think this would
    be something native C++ programmers could benefit from?
    Do you think it is possible to implement something like the BCL in
    native C++ and kinda "emulate" the .NET BCL behavior close enough?

    Looking forward to hearing a few opinions.
     
    Andreas Schmitt, May 17, 2007
    #1
    1. Advertising

  2. Andreas Schmitt

    Ole Nielsby Guest

    Andreas Schmitt <> wrote:

    > Crazy idea but...
    >
    > I think everyone could agree with the statement that the CLI standard Base
    > Class Library is incredibly useful, not to mention the extentions by
    > microsoft and managed directX and several other stuff that builds on top
    > of the BCL.
    >
    > [...]
    > Looking forward to hearing a few opinions.


    If that's the style you want, why not just use C#?

    IMO a merge of concepts from wxWidgets, VCL and the boost
    libraries would serve us better.

    As for things to come, I'm sad to learn that reflection won't make
    it into the next C++ standard - it's the CLI thing I really miss in C++.
    (VCL makes a nice attempt of grafting reflection on top of C++ but
    it would be much nicer if the language had support for it.)
     
    Ole Nielsby, May 18, 2007
    #2
    1. Advertising

  3. Andreas Schmitt

    rep_movsd Guest

    IMHO,

    Having used wxWidgets, QT, and VCL, I believe QT stands above all in
    terms of functionality and elegance. The fact that its crossplatform
    and has a GPL version is a big boost ( pun intended ).

    QT gives you everything you ever needed in a C++ framework.
    IO / Threads / GUI / Networking / Graphics manipulation / regular
    expressions and so on.

    The signal/slot arch is also a very convenient programming model.

    Im not familiar with the .NET side of things, but whenever I felt the
    need for soome functionality , I always almost found it already
    present in QT. After wrestling with wxWidgets for a long time QT came
    a very cool breath of fresh air.

    Vivek
     
    rep_movsd, May 19, 2007
    #3
    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. Andy Chau
    Replies:
    11
    Views:
    22,026
    Anoop M
    Jan 2, 2004
  2. main\(\){};
    Replies:
    3
    Views:
    1,059
    Steve McLellan
    Dec 14, 2004
  3. Markus
    Replies:
    1
    Views:
    475
    Markus
    Nov 22, 2005
  4. Replies:
    4
    Views:
    293
    Kenny McCormack
    Feb 21, 2006
  5. Replies:
    10
    Views:
    490
    Chris Gonnerman
    Dec 14, 2007
Loading...

Share This Page