Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Ptomaine on August 31, 2006, 05:30:12 pm

Title: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Ptomaine on August 31, 2006, 05:30:12 pm
'D' source files are ALWAYS UTF-8. I couldn't find any way to convert my source code file into UTF-8 in Code::Blocks (only converted by external tools). Maybe it is the time to let programmers to choose the source file encodings? Moreover, when handling 'D' projects it is natural to set UTF-8 encoding for the source files by default.

One more thing, 'D' source files can be compiled in 3 ways by now. Only 2 of them supported by the Code::Blocks IDE ('DMD' and 'DGC aka 'D' for GCC'). The third one is when using 'BUILD' tool (the most useful approach). It needs to be included in Code::Blocks too (http://www.dsource.org/projects/build/).
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: mandrav on August 31, 2006, 06:15:51 pm
'D' source files are ALWAYS UTF-8. I couldn't find any way to convert my source code file into UTF-8 in Code::Blocks (only converted by external tools). Maybe it is the time to let programmers to choose the source file encodings? Moreover, when handling 'D' projects it is natural to set UTF-8 encoding for the source files by default.

What's wrong with "Settings->Editor->Default encoding"?
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Game_Ender on August 31, 2006, 07:50:36 pm
Build and Code::Blocks overlap too much, build + D is just like make + C++/C.  If you want to use build you have to invoke it just like you would make.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Ptomaine on September 07, 2006, 05:23:10 pm
What's wrong with "Settings->Editor->Default encoding"?

What are you talking about? If you've ment "Settings->Editor->Default encoding when opening files" then you must know that it is NOT the way to improve the situation. I want to CREATE files in the neccessary encoding and even convert them if I need it.

Tell me, why I cannot convert files (source code or whatever) to any other encodings just within CB. I care this because the English language is not my native one and I make my comments and string constants in my native language. Why not to do just like Ultimate++ IDE allows you to do that? It's so natural tool and not so hard to implement? So why?????
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Ptomaine on September 07, 2006, 05:27:12 pm
Build and Code::Blocks overlap too much, build + D is just like make + C++/C.  If you want to use build you have to invoke it just like you would make.

Thanks for your explaination. But let me disagree with you. It is my responsibility to tune the build tool in a such a way that it works right for me. The only responsibility for CB is to call it and to pass the needed arguments to it. That's all.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: mandrav on September 07, 2006, 05:45:37 pm
Quote
Tell me, why I cannot convert files (source code or whatever) to any other encodings just within CB. I care this because the English language is not my native one and I make my comments and string constants in my native language. Why not to do just like Ultimate++ IDE allows you to do that?

Oh, no, another one...
Look Ptomaine, if you like [whatever_ide_goes_here] better, please, just use it.

Quote
It's so natural tool and not so hard to implement? So why?????

Because noone has sent a patch for it. It's that simple.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: aarti_pl on September 07, 2006, 07:11:06 pm
I send a patch (not for above problem, but anyway...), and it is still not included :-(

DMD and GDC 'D' compilers works also on linux, but they are disabled in codeblocks on linux. My patch turn them on when using codeblocks on linux. My patch is still not included into codeblocks.

Please include it into main svn tree.

PS. Patch in attachment. I work with it already for quite a long time on linux. It's relatively simple, so I don't think it is necessary to test it on every platform.

Regards
Aarti_pl

[attachment deleted by admin]
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Game_Ender on September 07, 2006, 08:43:23 pm
Quote from: Ptomaine link=topic=3950.msg31588#msg31588
Thanks for your explaination. But let me disagree with you. It is my responsibility to tune the build tool in a such a way that it works right for me. The only responsibility for CB is to call it and to pass the needed arguments to it. That's all.

You slightly misunderstood me.  I meant from inside codeblocks you invoke build with a custom make command, just like you do make.  It is not the responsibility of the CB developers to include build, just like they don't include make.  So using build is supported by Code::Blocks, you just have to get the program yourself.

Offtopic:  Have they renamed build to dbuild.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: afb on September 08, 2006, 03:34:32 pm
Something that I didn't understand was why DMD / GDC was new compilers ?
Shouldn't it (D) be more like a new language, next to the current C and C++ ?

Like this, for GCC:

Or for Digital Mars:

Then the *.d files could be of type "D" and use the setting for the D compiler ?


Meanwhile, I'm using the "CPP" type for D files - with a custom build command:
Code
     <Option compilerVar="CPP" />
     <Option compiler="gcc" use="1" buildCommand="gdc $options $includes -c $file -o $object" />

It is being used to build the wxD project, on all three platforms: MSW/GTK/Mac
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: afb on September 08, 2006, 03:37:02 pm
Offtopic:  Have they renamed build to dbuild.

Not yet, it seems... http://dsource.org/projects/build/
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Game_Ender on September 08, 2006, 04:07:12 pm
GDC is not a new compiler, it is a new frontend for GCC, much like GJC is java front end for GCC.  DMD is the reference/standard compiler created by Walter Bright (the language creator) and it basically sets the language feature set.  It uses the same optimizer and code generator that DMC uses.  In fact the frontend of DMD is the main part of the code for GDC.  D really needs to get its act together about shared libraries and such.  Last I checked (a few weeks ago) DMD couldn't create shared libraries on Linux, and separate compilation units have trouble with templates so GDC can't compile some of cooler template code.

EDIT: DMD can't create shared libraries on linux, had to update that.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: afb on September 08, 2006, 04:26:50 pm
Right, what I meant was: why are they new compilers in Code::Blocks ?
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Game_Ender on September 08, 2006, 05:47:59 pm
Wow, I was completely off base there that does make good sense.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Ptomaine on September 11, 2006, 01:13:07 am
Oh, no, another one...
Look Ptomaine, if you like [whatever_ide_goes_here] better, please, just use it.

You right! I use it for tasks I think it works better for me. And this IS NOT the reason for you to be aggressive to US. Usually, good companies pay very close attension to their customer feedbacks. Why you try to argue to me while I'm trying to help imporoving CB? I do not understand.

Quote
It's so natural tool and not so hard to implement? So why?????

Because noone has sent a patch for it. It's that simple.

It's not that simple at all. Read the previous posts.
-------------------------------

Anyway, I do not want to argue here. I want to discuss the subject and to get an answer.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: bigbug on September 11, 2006, 03:05:58 pm
Tell me, why I cannot convert files (source code or whatever) to any other encodings just within CB.
Is it, because you didn't try Edit->File encoding?
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Ptomaine on September 11, 2006, 03:50:54 pm
Tell me, why I cannot convert files (source code or whatever) to any other encodings just within CB.
Is it, because you didn't try Edit->File encoding?

I love you, bigbug :)
That's the answer I've waited for! :) Thank you a kind soul :)

Anyway, I think that encodings must be also pointed when creating files.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: mandrav on September 11, 2006, 06:24:27 pm
Oh, no, another one...
Look Ptomaine, if you like [whatever_ide_goes_here] better, please, just use it.

You right! I use it for tasks I think it works better for me. And this IS NOT the reason for you to be aggressive to US. Usually, good companies pay very close attension to their customer feedbacks. Why you try to argue to me while I'm trying to help imporoving CB? I do not understand.

I will help you understand then.
I am not aggressive to YOU. I am not aggressive towards anyone. If you took it that way, sorry but that's your problem.
And we are not a "good company". Actually, we are not a company at all. We work on this project on our free time, giving the fruits of our labour out for free. This fact alone should earn your respect, which apparently it doesn't. And I really don't care if you respect us for what we 're doing or not.

Quote
It's so natural tool and not so hard to implement? So why?????

Because noone has sent a patch for it. It's that simple.

It's not that simple at all. Read the previous posts.

The problem is when people start demanding that we implement stuff the way they want them. Sorry but it doesn't work that way. If you 're really interested to see a specific functionality implemented, all you have to do is implement it yourself and send us a patch. To me, it really is that simple. Like we implement stuff and commit for all of you to use them, I would expect the same from you, especially for functionality that you think is really missing.
If you can't do this, please submit a feature request and be patient.
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Zingam on September 11, 2006, 06:51:20 pm
What does it take that you accept a patch? How much time do you need to include it?

I have the idea to add another compiler support and to improve the D language support if I can.

BTW. Will C::B be always targeted at C++ only? Will it become more language independent some day? Let's say "assembly", Java, C#... etc? Except those I've mentioned there are quite a few other languages that do not have a good IDE.

C::B could be the solution :)
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: mandrav on September 11, 2006, 07:56:58 pm
Quote
What does it take that you accept a patch? How much time do you need to include it?

That depends. It can be applied in a day, or it can take longer. I 'm not pointing my browser constantly on the patches page hitting "Refresh" ;). And then some patches might target a different platform than the one I 'm currently on. Which means that I will have to remember checking the patches page again when I 'm on the target platform. This can take a while (or more than a while, in some rare cases).

Quote
Will C::B be always targeted at C++ only?

No. But "targeted" is not fully defined here. For example, you can edit non-C++ files now. You can even build them, with some effort. But you can't have code-completion for them.
At some point, all of the above will apply for non-C++ languages too but can't say exactly when...
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: afb on September 11, 2006, 10:25:35 pm
So it would be OK to work on a patch that adds D as a new language "proper",
instead of adding DMD and GDC as new (C/C++) compilers as currently used ?

Code
Index: src/sdk/compiler.h
===================================================================
--- src/sdk/compiler.h  (revision 2971)
+++ src/sdk/compiler.h  (arbetskopia)
@@ -130,6 +130,7 @@
 {
     wxString C; // C compiler
     wxString CPP; // C++ compiler
+    wxString D; // D compiler
     wxString LD; // dynamic libs linker
     wxString LIB; // static libs linker
     wxString WINDRES; // resource compiler
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: mandrav on September 11, 2006, 11:13:16 pm
So it would be OK to work on a patch that adds D as a new language "proper",
instead of adding DMD and GDC as new (C/C++) compilers as currently used ?

I have no experience with D whatsoever. If you think it's more correct to support it this way, by all means send us a patch :).
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: afb on September 11, 2006, 11:25:09 pm
Okay, I might just do that... :-)

If you want to know more about D, look at http://www.digitalmars.com/d/
And if you want to look at wxWidgets in D, see http://wxd.sourceforge.net/

Simplified: It's somewhere between C and C#/Java, and a sibling to C++...
Title: Re: 'D' compiler is not fully supported! UTF-8 to the masses :)
Post by: Game_Ender on September 12, 2006, 04:04:29 am
D is like C++ redesigned with some of the nice features Java and C# mixed in, but it keeps the uber powerful features of C++ like pointers and full power templates (ie not generics).