Dlang is C (pretty much)

Manu turkeyman at gmail.com
Thu Dec 17 23:07:27 UTC 2020


On Thu, Dec 17, 2020 at 4:45 PM Jessica Smith via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> I'm a python programmer closing in on 5 years of working with the
> language. I've dabbled in a fair number of other languages but
> Ive always come back to python.
>
> I have some experience working with c, but that's only through
> college projects. I wanted to pick up another systems programming
> language. Something fast and close to the metal. I chose d.
>
> The first thing that struck me as a potential pain point was the
> fact that d had very few libraries. It's community is a bit
> unresponsive. Some might say even comatose.
>
> I wanted to start by implementing a DNS server. So I checked to
> see if there was a DNS library I could use. D didn't have one
> that would fit the bill. At this point, I was wondering if rust
> or nim would make more sense. I dismissed both those languages
> early on cause of their respective syntaxes. They are not
> aesthetically pleasing to me. Somehow, d made sense.
>
> Here's where things got interesting.
>
> There is an excellent c library called ldns which powers the
> drill cli. I wanted to use that. Here's how you do this in d:
>
> Write an equivalent d file that mimics the header file of the c
> library you want to call into.
>
> Call the function
>
> WTF! D doesn't need extensions cause you can just use the c ones.
> Suddenly it feels like d has all of the plugins in the world as
> opposed to like three barely maintained libraries.
>
> I wanted to speed up a python app at work. Primary motivation
> behind picking up another language. d can fit in and just work
> with python as if I had written an actual c extension library. I
> get optional gc, type checking and speed. This is hands-down the
> coolest thing I have experienced. Suddenly d makes a lot more
> sense.
>
>
> https://wwwrouterlogin-net.com/
> http://amped-ampedwirelesssetup.net/
> https://tplinkwifinet-login.com/


Hooray! That is indeed the goal of investing in C/C++ compatibility. It's
meant to be an enabler, and it's nice to be aware of anecdotal cases where
that occurs.
It's often exclusively seen as using existing C stuff in your D apps, but
it's also the case that you can use D in gaps where C/C++ could only fit
previously (like your python extensions), the number of such use cases is
innumerable.
To be fair, most languages have some form of extern(C), but we have done a
good job to make sure it's really useful and (mostly) easy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20201218/6a677bd5/attachment.htm>


More information about the Digitalmars-d mailing list