Article discussing Go, could well be D

Jonathan M Davis jmdavisProg at gmx.com
Wed Jun 8 19:18:50 PDT 2011


On 2011-06-08 18:50, Daniel Gibson wrote:
> Am 09.06.2011 03:31, schrieb Andrej Mitrovic:
> > C libraries are great. They're flat and have little overhead.You can
> > build your own OOP/whatever-oriented interfaces around the library,
> > referencing just the functions that you need. Simple stuff compared to
> > some monsters like QtD.
> 
> You still have to generate/write the D bindings (and generating only
> works on windows) before you can use them.
> This may not be too hard in most cases, but certainly discourages
> newbies who just want to have ready to use libs.
> 
> And in some cases it can be hard, like when non-trivial macros are used
> (like for some unix socket stuff), or when there are a lot of custom
> types (and you can't just generate the bindings but have to write them
> yourself). In these cases it may sometimes be easier to write the code
> in C, exposing an even simpler interface suitable for your needs and
> call your own C functions from D (that's what I've done for
> aforementioned unix socket stuff: passing socket/file descriptors to
> another process needs those cmsg macros and structs).
> 
> But stuff like this probably discourages newbies even more, especially
> when they're not coming from C/C++ but Java or Python or something.

Yeah. It's fantastic that D can call C code, and it opens up a lot of 
libraries to us. But for a lot of programmers (particularly non-C/C++ 
programmers), that's a complete non-starter. They expect the libraries in D, 
not C, and requiring them to deal with C bindings is more than they're willing 
to put up with - particularly if they don't understand how easy it is to call 
C code, since you can call C code in many other languages, but it's generally 
much harder. And for many programmers from languages such as python and Java, 
they're used to having a _ton_ of libraries which do a ton of stuff for them 
where it's much harder to find C libraries which do it or it's much harder to 
do it with the C libraries than it is in those languages.

So, being able to call C code is fantastic and buys us a lot, but for a lot of 
programmers, that just doesn't cut it. They want the libraries to be in D.

- Jonathan M Davis


More information about the Digitalmars-d mailing list