Questions tagged [dmd]

Dmd stands for the Digital Mars D compiler.

The reference D compiler.

Usage:

Use as a generic tag.

199 questions
58
votes
3 answers

DMD vs. GDC vs. LDC

What are the Pros/Cons of the different D Compilers? How is the performance and the standard compliance/D2 support? How well are debuggers supported? How good are the Error messages and is the IDE integration? How good is the 64 bit support? My…
Fritz
  • 750
  • 1
  • 5
  • 8
26
votes
3 answers

What is a "yield return" equivalent in the D programming language?

Here is a simple generator in C#. IEnumerable Foo() { int a = 1, b = 1; while(true) { yield return b; int temp = a + b; a = b; b = temp; } } How do I…
Lurkeroid
  • 603
  • 6
  • 8
20
votes
2 answers

Elegant operator overloading in D

For a while I was confused about the direction of D's operator overloading, but now I realize it's a beautiful system... if It would only work with core types (int, float, etc). Consider the follow code: struct Vector { float X, Y; void…
F i L
  • 760
  • 3
  • 12
16
votes
2 answers

Which D Compiler to Use?

I would like to try out D but I'm not quite sure what compiler to use for it. I have found some articles, and also SO questions, on the topic, but I did not find any up-to-date ones. What are the benefits of each compiler, and what are the…
Jeroen
  • 15,257
  • 12
  • 59
  • 102
12
votes
1 answer

Rendering a simple rectangle with OpenGL 3 in D language

I'm going insane because I can't make a simple set of triangles appear in my screen. I'm using OpenGL3 (without the deprecated fixed pipeline) using the derelict bindings for the D programming language. Can you spot the error in the following…
Santiago V.
  • 1,088
  • 8
  • 24
12
votes
2 answers

Extension Functions in D

I bought "The D Programming Language" a little while ago. Great book, very educational. However I'm having trouble trying to compile a language feature listed in the book: Extension Functions. In the book, Andrei writes any function(a, b) can be…
F i L
  • 760
  • 3
  • 12
12
votes
2 answers

D programming language: module stdio cannot read file std\stdio.d

I installed dmd (2.0 ?) using the windows installer and am trying to compile the following program: module tcpechoserver; import std.stdio; const int MAXPENDING = 5; int main(char[][] argv) { if(argv.length != 2){ writef("Usage: %s…
lowerkey
  • 8,105
  • 17
  • 68
  • 102
11
votes
1 answer

How to use "Template Constructors" in D?

The template documentation for D includes a small section called "Template Constructors". That section doesn't have any example or extensive documentation. I'm attempting to use that feature (I'm aware that I could just use a "static constructor",…
11
votes
1 answer

Choosing Between GDC and DMD

I'm new to programming in D. What are the pros and cons of choosing either DMD (2.061) or GDC (4.6, 4.7 or 4.8, snapshot). And what GDC version should I pick? I've successfully built a recent snapshot of GCC-4.8 and GDC-4.8 and it compiles a hello…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
10
votes
1 answer

Building tangobos to work with DMDScript / Getting ECMA Scripting to work with D1-Tango

I'm trying to install DMDScript-tango on my win32 D1-Tango setup. The version I'm using is the 0.99.9 Kai bundle . When I try building it, I get the following error (among others) C:\DMD\sources\dmdscript>dsss build Creating imports for…
Frederik
  • 594
  • 3
  • 9
  • 24
9
votes
2 answers

d programming, parse or convert string to double

as easy as it is in other languages, i can't seem to find an option in the d programming language where i can convert a string (ex: "234.32") into a double/float/real. using atof from the std.c.stdio library only works when i use a constant string.…
Marnix v. R.
  • 1,638
  • 4
  • 22
  • 33
8
votes
5 answers

How to use gtkD in Win7 and dmd (D2)?

I downloaded gtkD-1.5.1 and extracted to some gtkD directory. What do I do next ? I don't understand if I have to compile and link it to some lib or just link to it in my code ? Edit: (@dsimcha) the command dsss build in gtkD main dir gave me…
Tar
  • 8,529
  • 9
  • 56
  • 127
8
votes
2 answers

d programming language : standard input problem or misunderstanding?

Here is a simple program that reads lines from stdin and outputs them to stdout. module test; import std.stdio; void main(string[] args) { foreach (int i, string line; lines(stdin)) { writeln(line ~ " (test)"); } } I'm using…
Redger
  • 573
  • 3
  • 11
7
votes
2 answers

Parsing a file with D

I am new in D and would like to parse a biological file of the form >name1 acgcgcagagatatagctagatcg aagctctgctcgcgct >name2 acgggggcttgctagctcgatagatcga agctctctttctccttcttcttctagagaga >name2 gag ggagag such that I can capture the 'headers'…
eastafri
  • 2,186
  • 2
  • 23
  • 34
7
votes
1 answer

D performance: union vs @property

I'm in the process of porting, enhancing, and D-atizing our reign SDK from C# to D. Currently working on the Vector2 math module. Will there be any performance difference between the two structs below? My benchmarks show identical performance, but…
F i L
  • 760
  • 3
  • 12
1
2 3
13 14