Live data from Hacker News

Why I Like D

aradaelli.com

121–130 of 134 posts

Re: Why I Like D

#121

Earlier quoted context omitted.

If you were in the authors shoes and you disliked C++ templates would you also have written off Go without trying it, though? No argument on going from D to something else but to not know either and not even try Go is what surprises me.

I was puzzled by strange linguistic ideas of go's designers. The reference to the English language can't justify go's syntax.

Do you have an example top of mind?

Re: Why I Like D

#122
post #99
post #89

Earlier quoted context omitted.

I don't disagree that it can be useful (eg. from one of the other projects mentioned in the thread: https://github.com/Netflix/vectorflow/blob/master/src/vector... ), and I definitely saw plenty of people that liked it. I think it existed in the same realm as a feature like lisp macros which are incredibly useful but when overused can turn the code into an inscrutable mess. The question for me was always how much the…

> b!(c.d)(a) The template parameter after a ! without parentheses is always 1 token, so it's never one of the first two interpretations. Furthermore, the point is that often when writing generic code, you're not supposed to care what the `.d` means specifically. For example, an `InputRange` is defined to have `.front`, `.empty` and `.popFront` properties. Is `.empty` a member variable, function, or constant? Doesn't…

Andrei and I have come to the conclusion that many of the library functions are overly generalized.

Re: Why I Like D

#123
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…

All of those create a copy of the array and do not modify the original, which may be important on cases like audio manipulation, where there are for instance 44,000 array entries per second. Furthermore, I wonder if D could automatically vectorize this operation when SSE/MMX style instructions are available?

Re: Why I Like D

#125

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

Actually, the truth is that Walter is a pretty poor D programmer who isn't that familiar with the language and knows next to nothing about the ecosystem outside dmd.

It wouldn't surprise me if he genuinely didn't know about how dstep and dpp are used.

Re: Why I Like D

#126
post #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…

Regarding GtkD, you may find this blog interesting: https://gtkdcoding.com/

Re: Why I Like D

#127

Earlier quoted context omitted.

The only way you can be saying this is if you haven't experienced metaprogramming in D. C++ does not compare at all. Generics do not compare at all. You can take D metaprogramming from my cold dead hands.

If you were in the authors shoes and you disliked C++ templates would you also have written off Go without trying it, though? No argument on going from D to something else but to not know either and not even try Go is what surprises me.

Yeah I do much in C# and almost never use generics. And when I do it is almost always not what I want.

D has me fooled and I can't imagine Go choosing to go further in D's direction over C#. I feel sorry for them.

Re: Why I Like D

#128
post #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…

Regarding GtkD, you may find this blog interesting: https://gtkdcoding.com/

i have read that with great interest :) it's part of why i was so surprised that no one seemed to be actually writing gtkd apps.

Re: Why I Like D

#129

Earlier quoted context omitted.

If you were in the authors shoes and you disliked C++ templates would you also have written off Go without trying it, though? No argument on going from D to something else but to not know either and not even try Go is what surprises me.

Yeah I do much in C# and almost never use generics. And when I do it is almost always not what I want. D has me fooled and I can't imagine Go choosing to go further in D's direction over C#. I feel sorry for them.

You almost never use List? Dictionary? IEnumerable?

Re: Why I Like D

#130

Earlier quoted context omitted.

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…

All of those create a copy of the array and do not modify the original, which may be important on cases like audio manipulation, where there are for instance 44,000 array entries per second. Furthermore, I wonder if D could automatically vectorize this operation when SSE/MMX style instructions are available?

It's not D that auto-vectorize such expression, it's the backend. Those "array ops" makes it easier for the compiler to convey that to the backend, though. Using LDC + arrays ops is often the best thing you can do speed-wise.
Post reply on HN