D Compilers

Pages: 12
I've been meaning to learn D for quite a while now. I'm under Linux Mint so I'll probably be using Code::Blocks.

I have the DMD and GDC D compilers installed. Which would you use/recommend, and why?
Last edited on
Sorry that this isn't related but...

Wow, it's you Xander!! Aka SFMLCODER!!! I've watched your SFML videos on youtube! You're freaken awesome.

You should make more SFML tutorials! I'm so surprised to find you here too. I guess this site must be really good since you use it. Your website is awesome too.
Thanks for the support hellohellomoon! This is a really great site, but you should know that there are a great many members on here far more experienced than me.

I want to make more SFML tutorials, but they kept getting invalidated when Laurent changed the SFML public interface. Therefore I'm trying to hold off until a stable SFML 2.0 release is made. In the mean time I'm thinking of continuing with my 'C++ Primer' series. See here:
http://sfmlcoder.wordpress.com/2011/10/24/sfml-coders-learning-c/
I'm hoping to upload a webcam video with details later today.
No problem! Again, you're like a celebrity to me. :D I have a feeling that you're a genius. You've already gotten your college degree at a very young age! That's really cool.

Yeah, I understand your decision about postponing your SFML videos until SFML2. When I was following your SFML tutorials, I've noticed that some things were changed as well; the sf::Key was changed for example.

I've watched all of your videos including your primers. In my opinion, though, I really think that the primers are not quite as useful because, there's so many beginner tutorials on Youtube already. Some examples would be TheNewBoston and antiRTFM.

They've both stopped making C++ videos at the point where it was beginning to get advanced.

No one has made advanced C++ on Youtube yet. You can't really find videos where it goes beyond the general basics such as pointers, polymorphism, classes, etc.

But, if you made videos on C++ concepts and not necessarily the syntax, I think that would be very helpful. Like, maybe, in one video, you can discuss about how C++ is used to develop games or other applications.

Like, after we know the basic syntax and functions of C++ like pointers and classes, how do we turn those things into games, applications, or whatevers.

I'm sorry if what I wrote is hard to read. I would like to make more suggestions if I could, perhaps on your website :). Anyways, I just want to thank you again for your videos and that you're the best teacher on Youtube !

I'm going to reply via PM so this thread doesn't lose it's original purpose - I still want to know what D compiler to use...
I would guess Digital Mars D (dmd) is the one to use, if only because it was someone working at Digital Mars who invented the language.
That was my initial reaction. I just thought that anything in the same vein as GCC had to be good as well ;)
Last edited on
Nice tutorials, but shouldn't you change the C++0x to C++11 now that the standard has been released?

As for D, I have DMD installed but not touched it yet. So I can't say for sure which one. As for which one to use, it depends on the companies implementation and interpretation of any standards or lack thereof for the D language. I suppose that would just be a preference call.
Nice tutorials, but shouldn't you change the C++0x to C++11 now that the standard has been released?

Yes, I should. However, I've neglected all my tutorial stuff recently so I haven't got round to it yet.
Lol- 314, you've got some fans =]

Speaking of D- what do you guys like about it? Anything in particular you've used it for in your toolbelt?
If I'm honest, I'll shamefacedly admit that I'm usually far too busy to apply my "toolbelt" to anything substantial :'(

I wanted to take a look at D because it has a fair bit in common with C++, particularly in terms of syntax; on the other hand I also wanted to get to grips with a more 'hand holding' language, but was not in the mood for Java or C# ;)
Last edited on
Haha, no worries mate, I actually started learning c# - talk about hand holding! Yesterday I went from no language knowledge to a stinking fully featured text editor in less than 4 hours o.O

I like that you don't have to have garbage collection enabled for D code, it looks pretty interesting. If I had more time ... =]

Speaking of Java as well, I started learning some, and I thought it strange that the main loop finds itself inside a class. But I plan on making this my 4th language anyways...

How is D for graphical stuff? Does it have graphics capabilities by default?
How are the libs?
Let me guess. Text editor in C#:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Form1 {
   TextEditor textEditor1;

   public void Initialize()
   {
      textEditor1.Initialize();
   }
}

class App {
   public void Main()
   {
      Application.Run(new Form1);
   }
}


I haven't really had much chance for D myself yet so I don't know what the libraries are like. I doubt graphics is inbuilt, as it's supposed to be an enhancement of C/C++. There is an SFML build for D in something like version 1.3. However, there appear to be D bindings in the new source though I don't know how to build them for D.

Optional garbage collection? That sounds interesting. Hadn't heard of that already - will have to look into it.
Haha, here was the editor =]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            if (System.IO.File.Exists("ULTI_TMP_BACKUP.BAK"))
            {
                richTextBox1.LoadFile("ULTI_TMP_BACKUP.BAK");

                /*System.IO.StreamReader tmp = new System.IO.StreamReader("ULTI_TMP_BACKUP.BAK");
                richTextBox1.Text = tmp.ReadToEnd();
                tmp.Close();*/
            }
            
        }



        

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {

            string frombox = richTextBox1.Text;
            int charnum = 0;
            int linenum = 0;
            for (int a = 0; a < frombox.Length; a++)
            {
                if (frombox[a] == '\n')
                {
                    linenum++;
                }
                else
                {
                    charnum++;
                }

            }
            lineLabel.Text = "Lines : " + Convert.ToString(linenum);
            charLabel.Text = "Chars : " + Convert.ToString(charnum);
        }

        private void fontDialog1_Apply(object sender, EventArgs e)
        {

        }


        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            richTextBox1.SaveFile("ULTI_TMP_BACKUP.BAK");

            /*System.IO.StreamWriter tmp = new System.IO.StreamWriter("ULTI_TMP_BACKUP.BAK");
            tmp.Write(richTextBox1.Text);
            tmp.Close();*/
        }

        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                System.IO.StreamWriter tmp = new System.IO.StreamWriter(saveFileDialog1.FileName);
                tmp.Write(richTextBox1.Text);
                tmp.Close();
            }
        }

        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                System.IO.StreamWriter tmp = new System.IO.StreamWriter(saveFileDialog1.FileName);
                tmp.Write(richTextBox1.Text);
                tmp.Close();
            }
        }

        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {

                System.IO.StreamReader tmp = new System.IO.StreamReader(openFileDialog1.FileName);
                richTextBox1.Text = tmp.ReadToEnd();
                tmp.Close();
            }
        }

        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = null;
        }

        private void fontTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (fontDialog1.ShowDialog() == DialogResult.OK)
            {
                richTextBox1.Font = fontDialog1.Font;
            }
        }

        private void changeColorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Random rnd = new Random();

            Color tclr = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
            richTextBox1.SelectionColor = tclr;
        }

    }
}


Seriously quick development in that environment!

Anyways, I had though so, ahh well, anyone else have any experience in D? It seems interesting.
Since we're on the subject, C# has quickly turned into my favourite language. I still don't know the language properly (every now and again, MonoDevelop will suggest me a keyword that I've never seen before) but I'm far more productive in it than C++. I think the thing I like most about C# is that everything in it seems very, very thoroughly thought-out (except references, I really don't get C# references; the reference system is the only thing I miss from C++). I think the .NET framework is very complete as well. I also like that I only have to write and compile my program once and it will run on .NET and Mono, even on Linux. I can even use code from a native DLL compiled on Windows and it will run on Mono on Linux. When I get the time I'm going to go through a C# tutorial so I don't miss out on anything (I nearly kicked myself when I found out about indexed properties after having written methods to do the same thing without realising it). I guess what makes C# so good is that they have literally thought of everything; everything you need is there. The language also feels much cleaner and more elegant than Java or C++. In Java you have system.out.println("hello, world") which is ugly and in C++ you have to left-shift std::cout by "hello, world" places which makes no sense. In C# it is Console.WriteLine("hello, world").
Last edited on
@chrisname I am definitely enjoying c#, it is pretty stinking awesome, and I agree with you the language is pretty well thought out. I have liked it much more than java. I kind of miss my delete keyword.... There are some interesting trade-offs going to these other languages, such as with java, you can't cast from a bool ( thought that was pretty weird). Altogether it's just nice to have more power to create code faster.
The only thing I think Java does better is replacing some operators with keywords, such as "implements" or "extends" instead of ":". It's more descriptive and leads to more self-documenting, and therefore easier to read and maintain, code.
closed account (1yR4jE8b)
bollocks

If you know C++, then : is just as readable. The only reason Java has two different keywords extends/implements is because they are semantically different, in C++ they are the same.
I was talking about C#, not C++. C# has interfaces so : can mean extends or implements.

Edit: I was also saying that I think keywords are generally better than operators.
Last edited on
Personally, I think I might prefer operators, but then again I'm a fan of obscure notation in general ;) Don't really know why though...

EDIT: On the subject of C#, I used to like it, but it was when I was younger so I didn't ever get on to some of the advanced topics. Now I primarily use Linux, is it still worth learning C# using something like Mono?
Last edited on
Pages: 12