.net - Why does C++ need language modifications to be "managed"? -
A compiler Why can not write Manage should be Manage In C ++ code (i.e. to make it "CLR compatible")?
Perhaps with some agreements, such as prohibiting zero indicators in some circumstances. But all these additional keywords etc. What is the problem with these joints?
I have some thoughts about some aspects and which can be difficult to solve, but a good concrete explanation will be highly appreciated!
I still have to disagree with the answer.
The main problem to understand is that it creates a C ++ compiler code which is suitable for a very dumb environment. Even a modern CPU has virtual functions, not know about hell, and even a stretch of functions. For example, a CPU does not care about the exception handling code to open the stack. With CPU's deal, jump and returns in sequence scenes. The tasks definitely do not have the name as the CPU is concerned.
So, is placed by the compiler all the things necessary to support the concept of a function like Vtables only array of the right size, with the true value of the CPU approach. are __ func __ string ends as bytes sequence in the table, which is the final 00.
Now, it adds nothing to the target environment Should be dumb . You can of course target JVM. Then, the compiler needs to fill the place that is not basically presented. Do not have any raw memory? Then allocate a big byte array and use it instead. Is there no raw signal? Just use the integer index in that large byte array.
The main problem is that the C ++ program is quite unknown to the hosting environment. JVM is not dumb, it knows about the work, but it expects them to be members of the class. It is named after its & lt; and & gt; does not expect you can control it, but who ends up with you he basically called Mangling and unlike the name confused today, thus the name of the company but not ideal for C Linkars Is for the environment. Therefore, the reflection engine it can be assured that the member function class with __ Namsthan_steeda_f_ic_agre_grej_in_pontr_aiti_pontr_ Fnkshn_dres std :: map strings in reverse.
On the other hand, in fact, very simple, in many ways other substations in C ++ can be overcome, to collect garbage? Before it is allowed in C ++, you can support it, even for zero * .
One thing that I have not yet done is to perform a large byte array to simulate raw memory? It's not going to be fast, especially if you put doubles in them. You can play a lot of tricks to make it fast, but at what price? You probably can not get commercially viable products. In fact, you can be with a language that is the worst of C ++ (many abnormal implementation-based behaviors) with the worst parts of VM (slow) Combines the parts.
Comments
Post a Comment