Live data from Hacker News

Why I Like D

aradaelli.com

71–80 of 134 posts

Re: Why I Like D

#71
post #67

Interesting language // Increment all elements by one (array-wise expression) half[] += 1; Is this really that useful? Seems like a weirdly specific code smell...

It can be a bit more general https://dlang.org/spec/arrays.html#array-operations

Looking at the notes, it may have separate syntax to make compiler vectorization and parallelization easier. Plus it's pretty terse.

Re: Why I Like D

#72
post #67

Interesting language // Increment all elements by one (array-wise expression) half[] += 1; Is this really that useful? Seems like a weirdly specific code smell...

I don't know D and just learning this syntax myself, and I'm genuinely interested in where you feel the smell is because I really like this syntax! For example:

I know Ruby, so here is what I'm used to:

  half.map { |i| i + 1 }
I also know Elixir:

  Enum.map(half, fn i -> i + 1 end)
...and JS, I guess because we have to:

  half.map(i => i + 1) // It looks just like the Ruby one
...vs whatever the Python version is... I don't know Python very well, but I imagine it involves list comprehensions...

Compare all those to the aforementioned D version :

  half[] += 1;
I'm really feeling the D version!

EDITED to fix little mistakes.

Re: Why I Like D

#73

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.

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…

> You can also: create a shared library in D and call it trivially from C

this is definitely a killer feature; i can think of very few languages that can do this. i think rust and zig are the only other two that have gotten any sort of popularity, though i would love to hear of any language i've missed.

Re: Why I Like D

#74

Earlier quoted context omitted.

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.

D programmers have also been in high demand in the industry, because D programmers tend to not need social proof, and tend to be self-educated and self-starters.

Walter, what do you mean by social proof in this context? Wondering if you have a brief example?

Re: Why I Like D

#75
post #55

Earlier quoted context omitted.

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.

No I mean I've seen bachmeier around the D community. possibly in IRC or the forums.

Re: Why I Like D

#76
post #70

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.

Partial aside, BetterC sounds a lot like Zig and Andrew Kelley moved to Oregon a year or two ago. Have you talked with Andrew? Funny that two of the language creators in the space are so close to each other on Earth. I'd love to listen to you two discuss D, BetterC and Zig and C.

I met him at Handmade Seattle last Nov. He's a good guy.

Re: Why I Like D

#77

Earlier quoted context omitted.

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).

__builtin_va_arg is another gcc compiler extension. It's for functions that deal with ... argument lists.

Re: Why I Like D

#78

Earlier quoted context omitted.

D programmers have also been in high demand in the industry, because D programmers tend to not need social proof, and tend to be self-educated and self-starters.

Walter, what do you mean by social proof in this context? Wondering if you have a brief example?

Social proof is buying a Ford car because your friends and family all drive Fords.

The old phrase "nobody ever got fired for buying IBM" is another one (though nobody has said that since 1990).

Re: Why I Like D

#79
i really want to use D for something, but it's just in that awkward spot where for any given project i can use ocaml instead. ocaml is in roughly the same part of the speed/expressiveness/pleasantness box as D is, plus i already know it.

i had two abortive attempts to use the language for specific projects - one was to wrap a C++ library and use it from D, but it turned out the swig bindings didn't work.

the second was to find an active gtkd-based app and contribute to it, to get a feel for desktop gui development (which seems on the surface like a very compelling use case for the language), but after asking on reddit no one could suggest anything other than tilix, on which development has stalled :( i would still love to do this, if anyone has something to suggest.

if anyone is involved in a fun desktop-based D project (CLI, TUI or GUI are all fine) please recommend it!

Re: Why I Like D

#80

Earlier quoted context omitted.

Quoted post unavailable.

Someone else made a really good point about hype today: 'One of the dumbest lessons I’ve learned in my career is that you should never disregard something that has hype behind it, even if you don’t think the tech makes sense. [0] Most “tech adoption” problems are really human coordination problems. Hype solves those. It doesn’t matter if you have a better solution, or that you think the proposed solution is stupid. […

> you should never disregard something that has hype behind it Do you have an opinion on how this sentiment applies to blockchain tech? I’m not trolling, I think the sentiment is interesting and blockchain tech seems obviously relevant to that sentiment.
Post reply on HN