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…
Sorry I should have been more clear. Incrementing every element in an array is much less useful than ".map()" which can execute a function on every element. It just seems like a weirdly specific syntactic sugar... which is a "language smell"... to me
Why I Like D
111–120 of 134 posts
Re: Why I Like D
#112Earlier quoted context omitted.
Speaking of people who have written C++ compilers, what do you think of Circle? Have you given any thought to targeting GPU shaders from D? I think "C-like low level control but with strong compile time metaprogramming" might be something of a sweet spot, though there is a lot of complexity to the space (mostly the oddball storage spaces).
there is DCompute for writing D programs on the GPU: https://github.com/libmir/dcompute it's pretty awesome
Re: Why I Like D
#113Earlier quoted context omitted.
> 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
#114Earlier 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.
Re: Why I Like D
#115Earlier quoted context omitted.
Apologies if I misworded what it's doing. It wasn't about name clashing, but readability. It's not clear at first glance what functions belong to which imports. As an example: https://tour.dlang.org/ Three imports and what appear to be four unqualified functions from them.
I'm sorry you don't like it, but that's a feature! But if there are identical names from two different imports, the compiler will demand that you qualify them. Or just use static import.
Re: Why I Like D
#116Earlier quoted context omitted.
> - Compiler availability (DMD vs GCC) > - Split stdlib Oh, yes, even as a complete outsider who merely reads D related threads from time to time, I remember these coming up repeatedly years ago. Both on HN and the programming side of reddit, among the top comments on D related threads. The tone was one of these being showstopper issues too. To be clear, I have no experience with D myself - the point is just about th…
They come up now still, in part because people read old hackernews threads and don't actually read our docs or other information i.e. the standard library issue (Tango vs. Phobos) has been resolved for 10 years.
Re: Why I Like D
#117Earlier quoted context omitted.
I first learned C++ 20+ years ago. While I've appreciated it, I also knew its shortcomings and had been looking for a replacement. D had some missteps along the way that lost some initial traction. I also wouldn't be surprised if timing was a factor with more C++ warts being added while the programming community has learned more lessons along the way that could be applied to the next languages (Go, Rust). As I follow…
the "Split stdlib" thing is about 15 years out of date (and only applied to D1, whose final release was in 2012). I wish that criticism would go away.
Re: Why I Like D
#118Earlier quoted context omitted.
I first learned C++ 20+ years ago. While I've appreciated it, I also knew its shortcomings and had been looking for a replacement. D had some missteps along the way that lost some initial traction. I also wouldn't be surprised if timing was a factor with more C++ warts being added while the programming community has learned more lessons along the way that could be applied to the next languages (Go, Rust). As I follow…
> shoehorning That happens to all languages over time. The more interesting thing is how well do those features fit in with the language's style.
[0] https://web.archive.org/web/20110320130326/http://www.digita...
Re: Why I Like D
#119Earlier quoted context omitted.
I'm sorry you don't like it, but that's a feature! But if there are identical names from two different imports, the compiler will demand that you qualify them. Or just use static import.
With all respect for all the work you've done in C++ and D but imo that is a mistake. This is one of the reasons I have a distaste for languages like C# and Ruby and prefer languages like Python and Rust. I've had a hard time following what is happening in other people's Ruby code because of this behavior. Whether items are imported from a module should be left up to the developer and not done on their behalf.
Well, the developer wrote `import thing;` instead of either `static import thing;` or `import thing : specific, list;` so it was their decision.
Re: Why I Like D
#120Earlier quoted context omitted.
the "Split stdlib" thing is about 15 years out of date (and only applied to D1, whose final release was in 2012). I wish that criticism would go away.
My post was about why D had a hard time gaining initial traction. I also brought up DMD vs GCC and I assume that was also resolved years ago.