d

improving gcc build times

I'm trying to improve the D front-end for GCC(GDC). I just got the d front-end compiling with GCC-4.3.1. But it took an awful long time compared to build it when I used GCC-4.1.2. This is the version of gdc: Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --enable-languages=d --prefix=/usr/local/gdc --e...

DMD 2 on Snow Leopard

Has anyone tried the Digitalmars D compiler (version 2) on Snow Leopard? I'd like to upgrade but I'd rather have a working D compiler. ...

Usage of D in the Field

I have tried to find some information on D. I do especially like this comparison with C++ to get an overview on what it is. Now I am asking myself: how often D is used in the field, and how much of a viable alternative is it to C++? ...

Checking whether an element in inside an array, using D?

We have a char and a char[]. What would be the most efficient (or, failing that, just simplest) way of finding out whether the char is located inside of char[]? The language used is D. Thanks! ...

D 1.0 (Tango) Move mouse; simulate keyboard presses etc.

Hey, I'm using D 1.041 with Tango 0.99.8 and was wondering how I would go about moving the mouse and simulating keyboard presses and getting infos from the screen, for example the color of a specific pixel on a specific coordinate. I'm using Windows. Any help would be greatly appreciated. I want to program a class-based library with fun...

Windows API function equivalents (SetCursorPos, GetCursorPos, mouse_event, keybd_event ...) for Linux (X11)?

I was wondering if there were equivalents of the above mentioned functions for Linux (X11) - I can't seem to find them. ...

How do I get gdb working with D programs under linux?

I have a patched gdb 6.8, but I can't get any debugging to work. Given this test file: import std.stdio; void main() { float f = 3.0; int i = 1; writeln(f, " ", i); f += cast(float)(i / 10.0); writeln(f, " ", i); i++; f += cast(float)(i / 10.0); writeln(f, " ", i); i += 2; f += cast(float)(i / 5....

Word Tearing on x86

Under what circumstances is it unsafe to have two different threads simultaneously writing to adjacent elements of the same array on x86? I understand that on some DS9K-like architectures with insane memory models this can cause word tearing, but on x86 single bytes are addressable. For example, in the D programming language real is a...

Some D template questions

Hi, I've been playing around recently with the D language and I have a quick question about templates. I'm inserting characters and strings into an existing string in code and came up with this function: string insert(T)(string s1, T s2, uint position) { return s1[0 .. position] ~ s2 ~ s1[position .. $]; } Now, I have several que...

How to use a C library from D?

Today I heard about the D programming and that it is compatible to C code. Nevertheless I haven't found any information on whether it is possible to use C libraries like GTK or PortAudio from D? If it is possible, could you explain how to do this? ...

What's the most efficient way to compare two blocks of memory?

I need a comparison function for blocks of memory for doing binary searches on arrays of bytes in the D programming language. It does not need to have any useful semantics. It only needs to be fast and be a valid comparison function (one that produces a total ordering). The blocks of memory to be compared are already known to be the s...

Are there other languages besides D with static if?

I think D's static if is an interesting language feature. That prompts my question: Are there are other examples of compiled languages in which the compiler has a strong notion of the code and there are languages facilities to access them? For example, this code provides something similar to repr from Python: char[] repr(T)(T value) { ...

When does template instantiation bloat matter in practice?

It seems that in C++ and D, languages which are statically compiled and in which template metaprogramming is a popular technique, there is a decent amount of concern about template instantiation bloat. It seems to me like mostly a theoretical concern, except on very resource-constrained embedded systems. Outside of the embedded space,...

Advice on implementing low-level libraries in D (as opposed to C/C++)

I need some advice on selecting the D programming language for a project. The project is a low-level library akin to a database with many associative containers and so forth. Hence efficiency is quite important to me. I need to provide a C API for the library for compatibility with other languages like C++ and Python and I also anticipa...

What next generation low level language is the best bet to migrate the code base ?

Let's say you have a company running a lot of C/C++, and you want to start planning migration to new technologies so you don't end up like COBOL companies 15 years ago. For now, C/C++ runs more than fine and there is plenty dev on the market for it. But you want to start thinking about it now, because given the huge running code base a...

Are there any game/graphics engines for the D programming language?

Are there any game/graphics engines for the D programming language? ...

D programming & iPhone

I've just started learning "D Programming". I'd like to deploy my programs on an iPhone. which has me wondering; is is possible to develop for a Mac or iPhone using D?. I'd like the application to be completely written D or at least minimal objective-c. Am I starting a hopeless battle by choosing D over the other mainstream languages ...

Are spinlocks a good choice for a memory allocator?

I've suggested to the maintainers of the D programming language runtime a few times that the memory allocator/garbage collector should use spinlocks instead of regular OS critical sections. This hasn't really caught on. Here are the reasons I think spinlocks would be better: At least in synthetic benchmarks that I did, it's several t...

Where to get Best resources on D language?

Where to get Best resources on D language? ...

Detailed Valgrind internals documentation

I'm thinking of making a D interface to Valgrind's client request API. By mucking around in the header files and de-compiling stuff, I could eventually figure out what it's doing but I'm wondering if their is a authoritative document on how things work? (BTW I already found this document but it doesn't have enough info) What I'm looking...