So what exactly is coming with extended C++ support?

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 30 13:00:50 PDT 2014


Am 30.09.2014 17:32, schrieb po:
> On Tuesday, 30 September 2014 at 14:19:51 UTC, Araq wrote:
>>> It doesn't mention anything about moving C++ into C#.
>>> Even with IL2CPP, C# has fundamental design trade offs that make it
>>> slower than C++(GC is just one of them), so it wouldn't make much
>>> sense to port engine code to C# unless they wanted it to run slower.
>>
>> What are these fundamental design trade offs?
>
> -GC
> -no meta programming vs meta programming

C# has meta programming capabilities via attributes, MSIL manipulation, 
reflection and having the compiler available as a library.

It is not as powerful or clean as D, but it gets the job done in many cases.

> -defaults to ref semantics C# vs value semantics C++

Yes, it is a bummer, but they do exist to a certain extent. One just 
needs to make use of them.


> -C++ supports unique types, C# does not

Lost me there.

> -C# lambda automatic/GC, C++ lambda fully customized via capture list

Which very few people understand properly and end up capturing the whole 
environment anyway.

>
>...
>
>   I don't really think this is the same situations. I don't think C# is
> any higher level than C++. Having a GC does not make it automatically a
> higher level language, nor does it make it more "productive".
>
>   That said, I think it is much easier to be productive in C# if you are
> starting from scratch, but with the proper setup & in depth knowledge of
> C++, it is every bit as productive(especially in games, where things
> like GC end up as more of a burden).
>

The problem is not everyone has good knowledge of C++.

I do use C++ on and off since 1993, and always advocated it vs C when it 
was considered slow(!). However I very seldom met fellow developers on 
projects with similar C++ knowledge, except for the time I spent at CERN.

I follow at the distance the game industry, having tried a few times in 
the past to be part of it. I was an IGDA member for a while, did attend 
developer meetups at the game development university in Düsseldorf and
buy regularly the game's development magazine of German studios.

Many middle size studios in Germany are now betting in C# 
(Unity/MonoGame) and Flash. Mostly for tooling and indie quality games, 
but sometimes all the way to production.

If D had already a GC that could rival with the CLR GC, it would be a 
great alternative for the said studios. Regardless what the decision 
regarding the D's answer to memory management will be.

Specially given that it can interoperate better with C and C++ than the 
marshalling required by the alternatives.

--
Paulo




More information about the Digitalmars-d mailing list