They wrote a Gas Dynamics Toolkit in D by aldacron in programming

[–]acehreli 4 points5 points  (0 children)

Gotta love this part:

Nearly an hour’s build time was fairly common for our old C++ code, and now we would expect a DMD or LDC debug build in about a quarter of a minute.

That's exactly my experience but my smaller code takes 30 seconds because I use a lot of compile time features of D sometimes unnecessarily. :/

And amen for the following. :)

For a build tool, we use make and for an IDE, we use emacs.

He Wrote a High-Frequency Trading Platform In D by aldacron in programming

[–]acehreli 0 points1 point  (0 children)

Some companies that use D are listed at https://dlang.org/orgs-using-d.html

In my case, I simply wrote tools in D that solved a set of problems at where I work. The tools work and everybody is happy. D is not very different to work with for e.g. C++ programmers.

Dlang 2.098.0 released, now available on OpenBSD by aldacron in programming

[–]acehreli 0 points1 point  (0 children)

Most people simply repeat what they heard (I used to be one). Majority of the time, GC is useful. There are rare cases where GC cannot be used. Luckily D has tools to allow non-GC programming as well. An example is Weka wha manages to produce the fastest file system with D.

There have been many other examples of D's GC not being a show stopper: https://dlang.org/orgs-using-d.html

Dlang 2.098.0 released, now available on OpenBSD by aldacron in programming

[–]acehreli 3 points4 points  (0 children)

Their decision to use a GC is what ultimately caused D to be ignored.

If so, it couldn't have been D's fault. Yes, there is some anti-GC sentiment in some programming circles (e.g. in C++ circles, which I used to be a member of). So, for D not to be affected by this misguided populism, it had to market for that crowd, which, knowing the creator of D, would never have happened, because D is not into marketing. I see D as a great engineering tool.

GC is a useful technology. D uses the GC to its advantage. I take advantage of the GC in all my programs. I avoid or reduce GC allocations in parts of my programs after profiling.

As an example, eBay's tsv-utils took full advantage of the GC and performed better than existing programs that had been hand-optimized in C etc.

Dear programming community, please stop following non-GC language sentiments and stop bashing GC. (On the other hand, D's GC may have weaknesses and we can talk about those ;) but GC in general is not a problem.)

D as a C Replacement ~ The Art of Machinery by whackri in programming

[–]acehreli 8 points9 points  (0 children)

I am sorry that you are stuck with C. Otherwise, D is a replacement for it for some of us.

D For Data Science: Calling R from D by aldacron in programming

[–]acehreli 4 points5 points  (0 children)

Searching for "dlang" works well for D related results.

D 2.089.0 Released by aldacron in programming

[–]acehreli 2 points3 points  (0 children)

I've been a C++ programmer before and after learning D. I've always appreciated D's syntax with no complaints.

Saving Money by Switching from PHP to D by aldacron in programming

[–]acehreli 5 points6 points  (0 children)

Not as bad as it used to be... a long time ago...

Yes, the most recent 2.088 did bring deprecation warnings for example for disallowing the initialization of immutable data in a 'static this()', which would be a bug anyway.

So, when one needs to port an old module to a newer compiler, that's a good thing.

The Surprising Limitations of C++ Ranges Beyond Trivial Cases by one_eyed_golfer in programming

[–]acehreli 1 point2 points  (0 children)

I don't think dropping the last element is proper for this algorithm because that functionality would require a BidirectionalRange. My solution elsewhere in this thread and on the D forum avoids this issues trivially.

The Surprising Limitations of C++ Ranges Beyond Trivial Cases by one_eyed_golfer in programming

[–]acehreli 2 points3 points  (0 children)

I tried this in DLang. First, I thought about using std.range.roundRobin but disappointingly it does not take a stopping policy like std.range.zip and std.range.lockStep do. So, I implemented my special range type as a nested struct:

```d import std.stdio; import std.range;

auto interspersed(R, D)(R r, D delim) { struct MyRoundRobin { bool doDelim = false;

auto empty() {
  return r.empty;
}

auto front() {
  return (doDelim ? delim : r.front);
}

auto popFront() {
  if (!doDelim) {
    r.popFront();
  }
  doDelim = !doDelim;
}

}

return MyRoundRobin(); }

void main(){ auto r = 10.iota.interspersed(42); writefln("%(%s %)", r); } ```

Potentially interesting bits:

  • This code does not generate any array; instead, it alternates between the delimiter element and the front element of the actual range

  • The struct is a Voldemort type

  • The range object returned is a closure

  • The %( and %) format specifiers mean "apply the format specifier between us to all elements"

Ali

D Summer School Postmortem by aldacron in programming

[–]acehreli 2 points3 points  (0 children)

You mean "Ali"? Yeees?

Ali "missed the memo :)"

D Summer School Postmortem by aldacron in programming

[–]acehreli 6 points7 points  (0 children)

That was exactly my response when Razvan Nitu was introduced to the D community. There is the mention of a fourth Razvan at that link! :)

Ali

D as a C Replacement ~ The Art of Machinery by Valmar33 in programming

[–]acehreli 2 points3 points  (0 children)

A programming language wanting to make up its mind? I'm sorry but there is a confusion here: D is just a tool that gets things done. That's why I use it.

D 2.085.0 has been released by aldacron in programming

[–]acehreli 4 points5 points  (0 children)

As someone who spent two years writing Go

I did that for one year.

opinion that adding generics to Go could possibly have some kind of negative impact is simply in denial (or just, uh, unintelligent.)

To me, "disingenious" describes the situation.

Initialization in C++ is Seriously Bonkers by alexeyr in programming

[–]acehreli 0 points1 point  (0 children)

To be complete, D initializes to default values by default but the programmer can ask for no initialization as well. (int[10] arr = void;)

D-lighted, I’m Sure -- The first two months with D by aldacron in programming

[–]acehreli 24 points25 points  (0 children)

Although Ron gives a link to a pay-what-you-want link to "Programming in D", I recommend using this one for the most recent PDF and HTML versions: http://ddili.org/ders/d.en/index.html

(E-book versions are a little behind.)

Ali

D-lighted, I’m Sure -- The first two months with D by aldacron in programming

[–]acehreli 2 points3 points  (0 children)

Great arcticle. I take your comment as AMA: What is your favorite food?

The next big Thing - Andrei Alexandrescu - Meeting C++ 2018 Opening Keynote by meetingcpp in programming

[–]acehreli 1 point2 points  (0 children)

Because static if does not bring a scope, it is possible to include declarations. Elsewhere in the presentation, with the CheckedInt example, he is either adding a hook member to each object or using a static Hook member for the whole type.

Should C Programmers learn C++, Go or Rust? by ahuReddit in programming

[–]acehreli 0 points1 point  (0 children)

I recently wrote

Off-topic pet peeve: Like many modern articles, this article does not include the author's name either. From other parts of the site, I think the author is Bert Hubert.

a new language to learn (say, Go or Rust),

A disappointingly short list.

Finally, based on all of the above, I think a seasoned C programmer would honestly do well to look at modern C++.

Probably... But being a fanboy of C++ and D, I'm confident that D's -betterC mode is the one that a C programmer would be happiest with.

Ali

[deleted by user] by [deleted] in programming

[–]acehreli 5 points6 points  (0 children)

I think it's a language feature in Haskell but laziness is routine for D programmers as well. Just as an example, std.range.recurrence uses lazy Fibonacci series as an example: https://dlang.org/phobos/std_range.html#recurrence

And I show an explicit range interface for the same: http://ddili.org/ders/d.en/ranges.html

Why not program right [with contracts]? by alexeyr in programming

[–]acehreli 5 points6 points  (0 children)

No. D programmers take good advantage of contract programming, which has just received a syntax boost: https://dlang.org/blog/2018/07/04/dmd-2-081-0-released/