Live data from Hacker News

Why I Like D

aradaelli.com

51–60 of 134 posts

Re: Why I Like D

#51

Yes, I just wished more people liked D so it got momentum.

I wanted to like D because I respect Walter a lot, and D's community probably has by far the highest SNR of any community I've visited... seriously smart people. But the language just wasn't for me. Right off the bat, the default import style which thrusts everything exported into the default namespace like C seems odd at this point. Apparently one can use what are called static imports, but as a code reader I can't…

The SNR point is well taken. It's probably why I find less popular languages to be more enjoyable. Practically anything Python or Javascript related is flooded with too much entry-level commentary and Medium articles (yick). Languages such as D, AWK, Prolog, etc etc attract those who have broken that threshold, generally many years ago.

Re: Why I Like D

#52

Earlier quoted context omitted.

Quoted post unavailable.

> compile times, ugly syntax, ergonomics This is why I write in Ada--it's C++98 with cleaner syntax and a bunch of nice/new features (array bounds, pre/post conditions, etc). It's package-based, so types do not "contain functions", so free functions, member function, who cares, it's all written and callable the same ways. There's even a real module system built in for decades with packages. You have to get over `begi…

> You have to get over `begin` and `end` though.

Ada would be smart to get rid of that.

Re: Why I Like D

#53

> Go did not have generic types at the time so I excluded it immediately I wonder how many people are missing out on Go for a feature they wouldnt miss 80-90% of the time?

Generic code is written with D a lot more than I'd originally anticipated.

Oh I dont deny that at all. D is on my list of languages to try precisely because it is more powerful / flexible than Go (and thank you for making it).

Just surprises me how quickly people write it off. Horses for courses!

Re: Why I Like D

#54

BetterC got a lot of resistance at first, along the lines of who needs it. (BetterC is a subset of D that only relies on the C standard library.) But over time it has accumulated a lot of users, as being C without the troubles. We've gone a step further with ImportC, and now C code can be imported directly into the D compiler, which makes it easy to interface D code to your existing C base.

ImportC is a killer feature, IMHO. Makes the choice to use D quite an easy one for a lot of tasks. But - it's not production ready yet, is it?

We're dogfooding it now. It's in a workable state, and keeps getting better. Besides, use it and file bug reports for anything not working perfectly.

Re: Why I Like D

#55

Earlier quoted context omitted.

> You seem to have some familiarity with the language. Well he should, he's the guy who created D.

I've seen that guys name around before, I assume he knows who Walter is and was making a joke.

You assume wrong. It's the real guy.

Re: Why I Like D

#56

Earlier quoted context omitted.

> compile times, ugly syntax, ergonomics This is why I write in Ada--it's C++98 with cleaner syntax and a bunch of nice/new features (array bounds, pre/post conditions, etc). It's package-based, so types do not "contain functions", so free functions, member function, who cares, it's all written and callable the same ways. There's even a real module system built in for decades with packages. You have to get over `begi…

> You have to get over `begin` and `end` though. Ada would be smart to get rid of that.

It's probably not removable after almost 40 years.

It has expression functions which you can wrap a return result in () and avoid it.

The important part is that it's surprisingly consistent in that 3 of the 4 structural elements are nearly all self-similar in their declare/begin/end format (protected type being the 4th and the difference).

Re: Why I Like D

#57

Earlier quoted context omitted.

> You seem to have some familiarity with the language. Well he should, he's the guy who created D.

I've seen that guys name around before, I assume he knows who Walter is and was making a joke.

The other WalterBright is the evil one.

Re: Why I Like D

#58

A colleague (who is probably one of the smartest people I've met) made VectorFlow targeting D: https://github.com/Netflix/vectorflow I've never had a chance to look at it much, but I think the magic is in the metaprogramming capabilities. It's more principled than C++ templates, more ergonomic than Scala macros, and more practical than Template Haskell. Somehow. (At least this was my impression from discussing it)

The library looks impressive, but I dunno about that sales pitch: isn't "more principled than C++ templates"… a pretty low bar? And isn't "more practical than Template Haskell"… also a pretty low bar? I would have asked the same rhetorical question of Scala macros a couple years back, but the Scala 3 macro redesign is indeed pretty nice.

Re: Why I Like D

#59

BetterC got a lot of resistance at first, along the lines of who needs it. (BetterC is a subset of D that only relies on the C standard library.) But over time it has accumulated a lot of users, as being C without the troubles. We've gone a step further with ImportC, and now C code can be imported directly into the D compiler, which makes it easy to interface D code to your existing C base.

ImportC is a killer feature, IMHO. Makes the choice to use D quite an easy one for a lot of tasks. But - it's not production ready yet, is it?

Unfortunately no. A lot does compile, though, if you can avoid compiler extensions. I downloaded the sqlite amalgamation today (several hundred thousand LOC) and ImportC only had two problems, one which was easy to fix, and one I don't know how to fix (__builtin_va_arg).

Re: Why I Like D

#60

Earlier quoted context omitted.

You seem to have some familiarity with the language. Nonetheless, you're understating a bit the degree of integration with C. You can also: create a shared library in D and call it trivially from C or any language with a FFI, call C shared libraries with little effort from D, compile a C file and add the .o file to your D program compilation command directly, use dstep to write C bindings for you, and directly #inclu…

real r/dontyouknowwhoiam moment here

More like r/woosh
Post reply on HN