473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

BCL for native C++ - possible?

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.
May 17 '07 #1
2 1932
Andreas Schmitt <ke**********@gmx.dewrote:
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.)
May 18 '07 #2
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

May 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: callmebill | last post by:
I'm getting my feet wet with making Python talk to MySQL via ODBC. I started on Windows, and it went smoothly enough due to the ODBC stuff that apparently is native to Python at least on windows...
1
by: Mike Kamzyuk | last post by:
Hello all. Basically, I need to call a mixed-mode dll's function (which uses managed code) from a native or mixed-mode dll function (which does not use managed code). I'm wondering if this could...
3
by: Xavi Sam | last post by:
Hi When I build my asp.net application the ASP.NET generates a net.assembly by page in the directory of my pc: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files Theese...
9
by: Lonewolf | last post by:
Hi everyone.. I was trying to implement callback fucntions in native codes in my VC8 class, and referred to some online codes which use native class nested within managed class. basically of the...
7
by: Daniel Dünker | last post by:
Hello. I was screwing around a bit with the exe-files produced by .Net Compilers and trying to understand how they work... so i ended up at the 6 Byte stub, which calls the _CorExeMain in...
1
by: Andreas Schmitt | last post by:
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...
2
by: Bob Altman | last post by:
Hi all, We have a native class modeled after the System::Exception class, and all exceptions that we throw derive from this class. For now this class is quite simple: just Description and...
6
by: | last post by:
Hi, I need to get the the display monitor native resolution.I have tried SystemInformation.PrimaryMonitorSize. it is giving the exisiting resolution of the display monitor that is connected....
5
by: marchaos | last post by:
I'm trying to override the native HTMLElement.addEventListener in firefox so that I can do some extra things. I know it's possible to add methods to the HTMLElement prototype and for them to be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.