Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: venix on November 03, 2005, 12:05:30 am

Title: Digital Mars D
Post by: venix on November 03, 2005, 12:05:30 am
To those interested. I added support for the D language (http://www.digitalmars.com/d/) and compiler to Codeblocks.  The patch can be found here (http://sourceforge.net/tracker/index.php?func=detail&aid=1346431&group_id=126998&atid=707418).  I will post a binary later on that should drop in replacement for the current release. I used 2.6.2 instead of 2.6.1 and that created DLL issues. So i have to recompile with 2.6.1 or whichver the release uses.

Binary Release
Codeblocks_with_d.exe (http://update.psycho-appz.net/codeblocks/codeblocks_with_d.exe) Compressed with 7zip
Dlink.zip (http://update.psycho-appz.net/codeblocks/dlink.zip)
I had to use wxWindows 2.6.2. Kept crashing without. So i've rebuilt all the included plugins.  The others didn't crash me at startup. Just download and extract over top your codeblocks folder. Will replce wxwindows dll.  I've included the sdk files.
More info (http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport#CodeBlocks)

It is experimental, but it works nice.  Until I start using it more, or others start using it and finding bugs, I cannot make any guarantees to its stability.

It WILL NOT remove support for C/C++ compilers or remove any functionality already existant to codeblocks as of that release. It will give shell extensions to .D files tho.

I haven't created templates for it. And I may never.

It don't support linux either.

You can follow the instructions on their site to install it. The DMD version not GDC.  The dlink program needs to be put into the bin directory of the compiler. It wraps gcc syntax to the official linkers. For those interested,  I couldn't find a way to generate Dlls without creating a def file.  So I made that proram to do it for me.
Title: Re: Digital Mars D
Post by: Michael on November 03, 2005, 10:05:27 am
Hello,

Interesting addition. Thanks for your work.

Best wishes,
Michael
Title: Re: Digital Mars D
Post by: tuft on November 15, 2005, 09:56:42 pm
I'm trying debug d program in codeblock I used gdb from codeblock instalation but it doesn't recognize executable format. Which version of gdb I should use?
Title: Re: Digital Mars D
Post by: venix on November 15, 2005, 10:12:47 pm
I'm trying debug d program in codeblock I used gdb from codeblock instalation but it doesn't recognize executable format. Which version of gdb I should use?
I haven't found a debugger for D executables.  They make a few suggestions on their site. http://www.dsource.org has one called dig dug, but i haven't tried it. GDB has a patch to support D if you use the gdc compiler.  I haven't played with that compiler at all.
Title: Re: Digital Mars D
Post by: Brork on December 04, 2005, 06:51:28 pm
This is really great, finally a good IDE for D.

Thank you very much!

I hope that this will be included in future releases of Code::Blocks.

And I also have a suggestion to change the way the compilation is works.

C::B should compile all source files with a single command like this:

dmd -c sourcepath1\source1.d sourcepath2\source2.d sourcepath3\source3.d

instead of like it is now:

dmd -c sourcepath1\source1.d
dmd -c sourcepath2\source2.d
dmd -c sourcepath3\source3.d

Compiling like this would make module- and packagenames independant of source filenames and directories.


Title: Re: Digital Mars D
Post by: JoeCoder on December 06, 2005, 05:13:44 pm
This is awesome... Now I can use my favorite IDE with my favorite language.
Only one problem.  The link is broken and has been for several days.  Anyone know of a mirror?  This seems too good to let it fade into oblivion.
Title: Re: Digital Mars D
Post by: venix on December 07, 2005, 04:26:30 am
This is awesome... Now I can use my favorite IDE with my favorite language.
Only one problem.  The link is broken and has been for several days.  Anyone know of a mirror?  This seems too good to let it fade into oblivion.

Ya, I have a linksys router.  Ain't the best of things.  Been having to reset it lately to restore my internet.  All should be good now.  And the files are still hosted. If you have a more permanent site, you are more than welcome to host them.  Also, the DLink ultility is umm, unsupported now.  I made it for dlls and DMD has is rather weak when it comes to that area.  Check the docs, and rewrite the linking commands to not use it. I belive the default Digital mars Compiler commands would work. As well as change the linker over.  But i think it does work still, its purpose was for dlls. Which are not supported by DMD.
Title: Re: Digital Mars D
Post by: JoeCoder on December 07, 2005, 11:20:10 pm
Nope, the links are still broken.  Email them to
eric (at) d512 (dot) com
and I'll put them up on my server and link to them here.  It's paid hosting so it should be pretty reliable.  Once that's done, you can add my server as a mirror to http://www.wikiservice.at/d/wiki.cgi?EditorSupport#CodeBlocks as well as anywhere else that may link to them.
Title: Re: Digital Mars D
Post by: JoeCoder on December 13, 2005, 07:50:48 pm
Still no luck at downloading or obtaining the files.

If anyone could send me the files I can host them.  Again, eric (at) d512 (dot) com
Title: Re: Digital Mars D
Post by: JoeCoder on December 15, 2005, 04:23:11 am
Ok, they're hosted at:
www.d512.com/host/codeblocks_with_d.7z (http://www.d512.com/host/codeblocks_with_d.7z)
www.d512.com/host/dlink.zip (http://www.d512.com/host/dlink.zip)

I tried it out and I was able to get a simple Hello World app to compile and run--I just had to go in and set the paths to dmd.exe, the linker, etc.  I'll try out more when I get time.  Switching from Context to Code::Blocks for my game engine should make development quite a bit easier--but I guess I'll find out soon enough.  Hopefully this can get included in the official releases!

Oh, and if anyone wants to update the dwiki page with these links, feel free to.  I'll keep hosting them for as long as I can handle the traffic.
Title: Re: Digital Mars D
Post by: JoeCoder on December 16, 2005, 06:07:15 am
Ok, I've tried it out and it works great!  My SDL / OpenGL (Derelict bindings) game engine compiles and links quite well.  Granted, it just draws some cubes with some lame render to texture and pixel shader effects, but at this point it's just a matter of making sure these things will work at all.  I haven't played with DLL's any and probably won't for a whle.
Title: Re: Digital Mars D
Post by: venix on December 16, 2005, 06:33:01 pm
I haven't played with DLL's any and probably won't for a whle.
If your interested in DLLs and D, i suggest using GDC.  Using mingw's builtin support for DLLs & some modifications to the dmd code, you can get full support for DLLs. At least by my definition. The current Compiler frontend code lacks the ability to export dlls without some modficiations tho.
Title: Re: Digital Mars D
Post by: Raindog on January 05, 2006, 05:33:12 am
I think it would be awesome if C::B went towards trying to provide a full fledged D IDE, the existing ones are not terribly great i'm afraid.

C::B Looks to be developing very nicely and I am very excited about it.

the D programming language looks to be a c++ programmers dream come true but it really needs a more focused community.
Title: Re: Digital Mars D
Post by: byo on January 05, 2006, 01:18:14 pm
Maybe You've noticed that compiler plugin is being highly worked on. And I quess (and hope so) that after "rebirth" it will be really easy to add D support.

BTW. I've looked into D specification and I really enjoy it. I vote for adding D support to C::B :D
Title: Re: Digital Mars D
Post by: Michael on January 05, 2006, 09:46:19 pm
the D programming language looks to be a c++ programmers dream come true but it really needs a more focused community.

Personally, I am still sceptic about D programming language. I have read its features and I like them :). Some C++ experts (and members of the standardization committee) have spoken good of it. Anyway D is not so known (a lot of people I have spoken with have never heard about it), there are no published books (may be I am wrong here :)) and also (and it is the most important point for me) no standardization process.

Anyway, I am in favor of a full integration of D in C::B :).

Michael 
Title: Re: Digital Mars D
Post by: rickg22 on January 05, 2006, 10:34:55 pm
If only we had GDC...
Title: Re: Digital Mars D
Post by: Michael on January 05, 2006, 10:43:41 pm
If only we had GDC...

May be GDC D Compiler (http://home.earthlink.net/~dvdfrdmn/d/)?

Michael
Title: Re: Digital Mars D
Post by: byo on January 06, 2006, 06:18:51 pm
Anyway D is not so known (a lot of people I have spoken with have never heard about it), there are no published books (may be I am wrong here :)) ...

Maybe it could be changed because of Code::Blocks  :D
Title: Re: Digital Mars D
Post by: Michael on January 06, 2006, 06:43:28 pm
Maybe it could be changed because of Code::Blocks  :D

Yes, you're right :D.

Michael
Title: Re: Digital Mars D
Post by: Dannerbeck_Dieter on January 20, 2006, 02:39:38 pm
Support for D?! Ok. Now Code::Blocks is my first choice! I will go for a translation into german.
Title: Re: Digital Mars D
Post by: Zingam on February 16, 2006, 03:21:25 pm
So I cannot get it to work with C::B the latest build? What should I do?
Title: Re: Digital Mars D
Post by: Michael on February 16, 2006, 03:56:51 pm
So I cannot get it to work with C::B the latest build? What should I do?

Are you using the latest nightly build, right? Which are the problems you are having?

Best wishes,
Michael
Title: Re: Digital Mars D
Post by: Zingam on February 16, 2006, 05:50:17 pm
Yes I use the build from yesterday.

Code
-------------- Build: default in D ---------------
Compiling: main.d
parse     main
semantic  main
object.d: module object cannot read file 'object.d'
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings


I'm trying to compile:

Code
void main()
{
    printf("Hi");
}



I've unpacked these two files:
dmc.zip
dmd.zip
into a subfolder of codeblocks main installation folder -> C:\Program Files\CodeBlocks\digital_mars\d\dmd
then I compiler stettings Digital Mars D -> Programs
C:\Program Files\CodeBlocks\digital_mars\d\dmd
Digital Mars D-> Programs->Additional paths
C:\Program Files\CodeBlocks\digital_mars\d\dm

and
C:\Program Files\CodeBlocks\digital_mars\d\dm\bin


and I cannot compile.

NOTE: I've never used D. I'd like to try it but I don't want to use command line tools? So my questions are:
- How to make Code::Blocks to compile D sources.
- Where to find good tutorials/books
- How can I debug (can I use CB and gdb)?
- Should I always use set D compiler as default before I start a new D project? Can I use C/C++ and D (two compilers, without to select them manually) or a project type can specify which project should use which compiler?


What I've done too is to modificate the Console Application template, so it generates a simple template just like for C.

That's more elaborate now  :shock: I hope somebody can answer my questions :) I really love :) "exotic" things :) like new languages.
Title: Re: Digital Mars D
Post by: Michael on February 16, 2006, 06:34:15 pm
- Where to find good tutorials/books

You can find a lot of D info at the Digital Mars website (http://www.digitalmars.com/).

Best wishes,
Michael
Title: Re: Digital Mars D
Post by: Zingam on February 16, 2006, 09:50:38 pm
I've managed to make it compile. But what about debugging. Is debugging of D programs supported within CB and gdb?

I also tried to run gdb from the command line but it says that it cannot recognise the file format of the D program. It works with a C++ program.
Title: Re: Digital Mars D
Post by: sethjackson on February 16, 2006, 09:55:11 pm
I don't see why it would work with GDB..... C++ and D are two different langs and I think that GDB is only for C/C++ AFAIK.
Title: Re: Digital Mars D
Post by: Michael on February 16, 2006, 10:00:31 pm
I've managed to make it compile. But what about debugging. Is debugging of D programs supported within CB and gdb?

I also tried to run gdb from the command line but it says that it cannot recognise the file format of the D program. It works with a C++ program.

I have found this link (http://www.digitalmars.com/d/archives/21795.html). May be it is useful for you.

Michael
Title: Re: Digital Mars D
Post by: Michael on February 16, 2006, 10:02:42 pm
I don't see why it would work with GDB..... C++ and D are two different langs and I think that GDB is only for C/C++ AFAIK.

Well, I thought the same, but here is what Walter from Digital Mars says (from the link above :)):

Quote
Any debugger that uses standard debugging information. If using linux, you can use gdb. If using Windows, you can use, for example, Microsoft's windbg.exe program (which comes on the DMC++ CD).

Best wishes,
Michael
Title: Re: Digital Mars D
Post by: Zingam on February 18, 2006, 06:38:09 pm
It seems to me that CB does not work with DMD properly. It does not apply the switches and sometimes when I set a switch and then reopen the Build options dialog it is not set.

Why are there two discriptions for the -g switch too?

I believe this is a bug? Where should I report it :) and hopefully somebody will fix it.

:) I hope next release of CB with MinGW will feature the GDC and a working debugger in the package too.