d

Cross platform GUI Programming with D

I want to start programming with D. I have a simple application in mind that needs a GUI but I want to make sure it's portable to Linux/Windows/Mac equally well and with minimal (no) change for each platform. wxD is looking like the contender of choice because I know the wx toolkit already. I see fltk4d as a contender and a (unfinishe...

Alloca implementation

How does one implement alloca() using inline x86 assembler in languages like D, C, and C++? I want to create a slightly modified version of it, but first I need to know how the standard version is implemented. Reading the disassembly from compilers doesn't help because they perform so many optimizations, and I just want the canonical f...

Why isn't the 'D' language picking up?

Anybody using language 'D'? Why isn't it more popular? ...

Is there a way to ensure that member functions are virtual in D?

As I understand it, all member functions are virtual in D but the compiler is free to make functions non-virtual if it sees that they are never overridden. What I'm not clear on is what happens when you compile a module in which member functions are not overridden and then import that module somewhere else where you override a member fu...

D Templates: Sort a list of types

Assume you have a type like the following: struct Value(int v_) { static const v = v_: } How would you sort a list of these types, assuming an interface something like this: alias Sorted!(Value!(4), Value!(2), Value!(1), Value!(3)) SortedValues; You may use D 2.x features if it makes for a better solution, but please state if you...

What is the current status of D standard libraries?

There are two of them Phobos and Tango. As far as I know they are redundant and incompatible. Are there any plans to join them? If so, when will it happen? ...

Improving raytracer performance

I'm writing a comparatively straightforward raytracer/path tracer in D (http://dsource.org/projects/stacy), but even with full optimization it still needs several thousand processor cycles per ray. Is there anything else I can do to speed it up? More generally, do you know of good optimizations / faster approaches for ray tracing? Edit:...

I need a serialization framework for D

I'm looking for a D template library to take an arbitrary variable and marshal it into a transportable bundle. The variable might be a basic value type (int, char[], real) or might be a struct or class and even might contain or be a reference type. A system that can do this without any per type help would be nice but I suspect that it's ...

How do i use std.socket and std.socketstream? (D programming language 2.x)

i was wondering how to use those phobos modules to use networking? Or you can give a reference to how to use sockets (in a way similar or almost similar to D) ...

What should i use : functors, interfaces or abstract methods when writing an abstraction(compatibility) layer? (D language)

For example: a compatibility layer between scripting objects (like strings, arrays) or scripting engines( eval() ,readFile() etc.). ...

Calling gdc/dmd shared libraries from Python using ctypes

Hello, I've been playing around with the rather excellent ctypes library in Python recently. What i was wondering is, is it possible to create shared 'D' libraries and call them in the same way. I'm assuming i would compile the .so files using the -fPIC with dmd or gdc and call them the same way using the ctypes library. Has anyone tr...

BSD-new license binary redistribution clause

The following is a clause in the new-style BSD license: Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. I've translated some BSD-licensed C code into the D programming language and a...

What's the best IDE for DigitalMars D programming?

Digital Mars D seems to be very good programming language in a lot of ways, but my only problem with it is the amount of time wasted writing arguments to the compiler in the command line at the old fashion way. Is there any good IDE for D? Thanks in advance! ...

C/D line drawing package

I find my self in need of a line drawing package. I need to pop a window and draw lines and points. Text would be nice but I can live without it. Most importantly, I need something that is dirt simple to get running. I don't have time to dink around with libs (if I did have time I'd be willing but I'm already way behind as it is). I'd p...

Compiling with DMD on 64bit Linux or Linking with 32bit object files

What is the best way to compile programs with DMD on a 64bit machine? It doesn't need to compile to 64Bit code. I know about GDC, but want to work with D2 also. There is also chroot, but am hoping for a simpler way. The actual problem isn't with compiling, but linking. DMD calls on GCC to perform linking with system libraries. Could I g...

building a web crawler

im currently developing a custom search engine with built-in web crawler. for some reason im not into multi-threading, thus so far my indexer was coded in single-threaded manner. Now i have a small dilema with crawler im building, can anybody suggest which is better, crawl 1 page then index it, or crawl 1000+ page and cache then index? ...

How to uniquely identify a user defined type in D?

I need to generate something that can be used as a unique handle for a user defined type (struct or class) in the D programming language. Preferably this would be a compile time computable value. I want the handle to relate to the name of the type as well as change if the internal structure (data layout) of the type changes but remain th...

What is eth_addr_t and friends in libdnet

I'm attempting to create a wrapper around libdnet for the D programming language. The issue I have run into is not knowing what the underlining types for eth_addr_t, ip_addr_t, and ip6_addr_t while converting addr.h. The last mystery type is sockaddr And I'm also interest in why there is a do while loop that is always false. #define ad...

Handling key presses in GTK+ (gtkD)

I'm playing around with gtkD (a D binding for GTK+) I have a window object, instance of gtk.MainWindow. I want to handle keypresses on it. How? How do I deal with special keys (e.g. arrow keys, pgup/pgdn etc)? PS I know these kinds of questions can be answered with google and stuff, but I've seen much "simpler" questions on stack...

Experiences with D-programming-language

Has someone here ever had experience with the D programming language? It seems to have many nice features but will it ever reach the popularity of those currently widespread languages like C++, Java or C#? So is it worth learning or is it an isolated language with minor prospects. ...