May 16, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote: > "Hasan Aljudy" <hasan.aljudy@gmail.com> wrote in message news:e4dcel$1d2v$1@digitaldaemon.com... > >> Good to know. :) >> >> I would love to participate in such a project, but my knowledge of graphics APIs is next to nothing. > > Pah, it's not hard to pick up.. just set a couple states, load some data, and draw ;) > >> Do you have a website for the project? can you possibly put it on dsource? > > I have a download thing, at http://jamesdunne.no-ip.org/nonagon/projects.php, but no real project page. I've been planning on making it open-source as of late, since I can't seem to find the time/drive to work on it for long periods of time. Right now, it's in a very transitional state, as I've been reworking a lot of the internals of the engine, splitting apart the two pipelines, cleaning up dependencies, refactoring some code, and working on getting model animation working (which it is, for the most part, at least in the fixed-function pipeline). But I'd still like to make a page for it on dsource or something. > > I would be interested in making this a premier game solution in D with you. Dsource would be the way to go to collaborate. -- Kyle Furlong // Physics Undergrad, UCSB "D is going wherever the D community wants it to go." - Walter Bright |
May 16, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kyle Furlong | "Kyle Furlong" <kylefurlong@gmail.com> wrote in message news:e4decl$1fhe$1@digitaldaemon.com... > I would be interested in making this a premier game solution in D with you. Dsource would be the way to go to collaborate. That would be sweet. Of course, I'd have to learn about things like code repository systems.. |
May 16, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> I want to sum up some issues that would have to be resolved in order for D code to call some arbitrary C++ code that is presumed to be unmodifiable.
I seriously plead that we don't even think about this before D 1.5!
Please.
|
May 17, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | > The only C++ code I've been able to convert without much difficulty is > my own, and that's because I use a gc with my C++ projects, and I deliberately write it in a D style. You can see that in the DMD front > end source. Are there guidelines for writing C/C plus plus in D style? I'm involved in several freeware projects that I've considered converting to D when 1.0 is released. Are there things I could be doing (and not doing) now to facilitate that? |
May 17, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | Georg Wrede wrote:
> Walter Bright wrote:
>> I want to sum up some issues that would have to be resolved in order for D code to call some arbitrary C++ code that is presumed to be unmodifiable.
>
> I seriously plead that we don't even think about this before D 1.5!
>
> Please.
LOL! It isn't going to happen. But it comes up often enough that it's worth writing some explanation down.
|
May 17, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lynn Allan | Lynn Allan wrote:
>> The only C++ code I've been able to convert without much difficulty
> is
>> my own, and that's because I use a gc with my C++ projects, and I
>> deliberately write it in a D style. You can see that in the DMD
> front
>> end source.
>
> Are there guidelines for writing C/C plus plus in D style?
>
> I'm involved in several freeware projects that I've considered
> converting to D when 1.0 is released. Are there things I could be
> doing (and not doing) now to facilitate that?
No, there are no guidelines. But you can look at the dmd source and get a feel for it.
|
May 17, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | In article <e4dclr$1d7m$2@digitaldaemon.com>, Jarrett Billingsley says... >I have a download thing, at http://jamesdunne.no-ip.org/nonagon/projects.php, but no real project page. I've been planning on making it open-source as of late, since I can't seem to find the time/drive to work on it for long periods of time. Right now, it's in a very transitional state, as I've been reworking a lot of the internals of the engine, splitting apart the two pipelines, cleaning up dependencies, refactoring some code, and working on getting model animation working (which it is, for the most part, at least in the fixed-function pipeline). But I'd still like to make a page for it on dsource or something. Thanks Jarrett, I know this project and I am waiting the RC5, and you know the D3DX9 currently has a version of 28. It's a wonderful thing if you can upgrade newer version of nonagon. |
May 17, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote:
> "Kyle Furlong" <kylefurlong@gmail.com> wrote in message news:e4decl$1fhe$1@digitaldaemon.com...
>
>> I would be interested in making this a premier game solution in D with you. Dsource would be the way to go to collaborate.
>
> That would be sweet. Of course, I'd have to learn about things like code repository systems..
>
>
That'll take all of 5 minutes ;)
|
May 18, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | IMO, Accessing C++ code from D is not a feature that should be supported by the D compiler. There has been some attempts to build C++ wrapper generators for D: swig, a macro system and I even made one myself (but the memory management is ugly). We just need C void * pointers. There are (and will be) brilliant people who (will) make great tools for D. The impatients (like me) can try to link with the ones they used in C++. We need time. I also tried to make a C++ to D translator by modifying Peri's Hankey d2d language machine script. It can handle small sized code and output quite syntactically correct D code but the semantic is incorrect, especially for templates because of the overwhelming "template <T>" syntax. I've given up for the moment. A translator is not enough: a C++ compiler to D could eventually do it but sounds like nonsense. Being a successor of C++ doesn't means that D should support it. Java does not support C++ and this lack has not prevent it to spread. |
May 18, 2006 Re: Accessing C++ code from D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rémy Mouëza | >IMO, Accessing C++ code from D is not a feature that should be supported by the compiler. >There has been some attempts to build C++ wrapper generators for D: swig, a >macro system and I even made one myself (but the memory management is ugly). We just need C void * pointers. There are (and will be) brilliant people who >(will) make great tools for D. The impatients (like me) can try to link with the ones they used in C++. We need time. Swig works well for what it does. Generally however you have to devote quite a bit of time to a swig wrapper to keep it in sync as well. >I also tried to make a C++ to D translator by modifying Peri's Hankey d2d >language machine script. It can handle small sized code and output quite >syntactically correct D code but the semantic is incorrect, especially for >templates because of the overwhelming "template <T>" syntax. I've given up for >the moment. A translator is not enough: a C++ compiler to D could eventually >do it but sounds like nonsense. I don't think a C++ to D translator is possible or even a good idea. Cpp simply would not translate into equivalent D idioms except in trivial instances. That being said, Cpp/D interop is a completely different animal. With interop, you're not trying to translate one idiom into another, instead you're just making it easier for each to co-exist, and to be able to easily access the functionality of one from within the other without rewriting. Microsoft's Cpp/CLI is an excellent example of how interop can work. Cpp is not C#, but it allows you to work with C# objects, members, enums, and GC from within a traditional Cpp program in a reasonably effective manner, and without having to rewrite your C# code in Cpp, or vicsa versa. Cpp interop is not "translation". It would be limited to being able to access members of a cpp class, call cpp member functions, use C and Cpp macros, and inline C or Cpp code. Parsing of Cpp headers would be handled by the Cpp compiler's parser using GCC-XML. And compiling of Cpp interop code for templates, macros, and other complex Cpp elements would be handled by the Cpp compiler, and accessed in D through C functions. For example, with this system, the issues you had with templates simply don't arise because templates are not converted into D template code, they are specialized nto standard Cpp classes and compiled with the Cpp compiler, and those classes are called from the D/Cpp interop system. >Being a successor of C++ doesn't means that D should support it. Java does not support C++ and this lack has not prevent it to spread. Yes, and yes. Yes it certainly should support interop if there is any real intention of being a successor to Cpp. And Yes, interop issues are part of the reason why the new .NET system is gaining ground against Java. Both microsoft C# and Cpp have interop with eachother. C# has unsafe code, which is completely compatible with C and Cpp, and Cpp has complete interop with the .NET world, including C#. Outside of the D forums in the general programming world these issues are not really controversial. They are considered self evident and obvious. This is why D is not a real alternative to Cpp or C for most programmers. The successor to Cpp will not be D, it will be Cpp 0x. |
Copyright © 1999-2021 by the D Language Foundation