BCL for native C++ - possible?

A

Andreas Schmitt

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.
 
O

Ole Nielsby

Andreas Schmitt said:
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.)
 
R

rep_movsd

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
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top