473,320 Members | 1,829 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,320 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
1 1512
Now.. do you think it would be possible to port the BCL to C++?
>
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.
No.
The world (at least the part that I occupy :-) ) is not waiting for Yet
Another Toolkit.
You could never copy the behavior for 100%, which would lead to all kinds of
confusion.
On top of that, what would it add?

Yes the BCL is useful, but only in the context of the whole .NET framework.
Replicating the BCL implies replicating the whole context it is used in.
That brings me back to the question 'Why on earth would you invest millions
of dollars to create something that already exists today' and believe me,
before you'd have something like that programmed and validated through QA,
you are at least 5 years down the line, have invested millions of dollars,
with a functionality of the BCL that is 2 major versions out of touch with
the then current release.

And then you'd have to find paying customers to turn this money drain into a
money fountain.
Which would boil down to convincing customers that they would benefit from
your expensive proprietary version 1.0 implementation than from using a
framework that is stable, and used by (and compatible with) the whole world
and his dog.

For native C++, I'd stick with STL (because it is part of C++) and possibly
the TR1 libraries (for example those of dinkumware) because they will be
part of the next C++ standard.

--
Kind regards,
Bruno van Dooren MVP - VC++
http://msmvps.com/blogs/vanDooren
br**********************@hotmail.com
May 18 '07 #2

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...
3
by: dfranzen | last post by:
Hi *, I'm in the process of porting an ANSI C++ project from a UNIX platform to .NET. After "getting rid of" some platform-specific stuff I managed to compile the first two libraries into mixed...
2
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.