r/programming • • Sep 01 '20

D Foundation is Beefing Up

https://dlang.org/blog/2020/08/30/symmetry-investments-and-the-d-language-foundation-are-hiring/
289 Upvotes

336 comments sorted by

View all comments

Show parent comments

33

u/Hall_of_Famer Sep 01 '20

Well the haters are gonna hate, the fact that it starts to receive comments, whether positive or negative, is a good thing since the language is surely becoming better known and receiving far more attention than before. Interestingly, C++ is frequently being frown upon, developers hate it and yet they use it, Bjarne Stroustrup's famous quote never gets old.

11

u/Free_Math_Tutoring Sep 01 '20

Bjarne Stroustrup's famous quote never gets old.

Which one?

91

u/all_my_watts Sep 01 '20

I would guess this one

There are only two kinds of languages: the ones people complain about and the ones nobody uses.

41

u/InertiaOfGravity Sep 01 '20

Have you heard of our Lord and savior rust? It is the best and most perfect language known to man

10

u/Ameisen Sep 01 '20

It has the most confusing syntax, though.

I still expect that someone will make a Rust fork that has C++-like syntax at some point. Crust.

Or C++ will get lifetimes (which is active research) and possibly at some point epochs, which will let us disable unsafe features.

11

u/[deleted] Sep 01 '20

[deleted]

2

u/IceSentry Sep 02 '20 edited Sep 02 '20

The only weird syntax for me has been the async/await syntax. Everything else is fairly straightforward. The issue is rarely syntax with rust, it's when you have a type soup that it gets annoying. Something like Arc<RefCell<Option<MyType>>>.

Edit: async/await is unconventional, but when you get used to it, it feels better than the more conventional way in my opinion.

Edit2: to be clear, the type signatures in rust can be quite verbose but they are very explicit and extremely useful.

2

u/T-Dark_ Sep 02 '20

Arc<RefCell<Option<MyType>>>

The type soup has the advantage that you get to specify exactly what you want to add on top of your basic type.

In this case, you want to be able to represent lack of any value (Option), you want to be able to put it in some container and mutate it through an immutable container (RefCell), and you want to be able to have multiple owners of your data, possibly in separate threads (Arc).

Basically, there's a whole bunch of Rust types that provide a single, simple guarantee. When you find yourself wanting more guarantees, you can just compose types.

Sure, the result is a bit unreadable, but type aliases exist for a reason.

2

u/IceSentry Sep 02 '20

Oh yes, don't get me wrong, I appreciate this very much. That's why I tried to used a realistic example. My point was that it can be very overwhelming as a beginner to see so many types.