Live data from Hacker News

Ask HN: Why do you use Rust, when D is available?

news.ycombinator.com

21–30 of 262 posts

Re: Ask HN: Why do you use Rust, when D is available?

#21

Because Rust is new and shiny. People who use Rust aren't using it to solve real world problems, they're using it to scratch a novelty itch. D is a tragedy in my opinion. It's an excellent language that just doesn't fit the political needs of any of the big players. We have Swift which is a worse version of C#, we have Go, we have Java. Why don't we have a single language so that we can do cross platform development…

The new and shiny has already moved on to Pony, Zig, or whatever.

Re: Ask HN: Why do you use Rust, when D is available?

#22
post #9

Engineers learn languages because of success stories by other companies—not by the merits of the syntax or one-off tricks like compiling itself in 5 seconds. The fact that Firefox uses Rust for the browser engine or that Dropbox uses Rust for the sync engine is the kind of thing that gets me interested.

Are you implying that D is slow at compiling regular code but fast at compiling itself, because of some cleverness? Is that actually true?

Lol, the person you're replying to never said, nor implied that.

I'm not trying to knock you, but your comment reminds me of the type of exchanges where one person says says "men do a lot of work", and the other person replies "are you saying women are lazy?"

Re: Ask HN: Why do you use Rust, when D is available?

#23
post #9

Engineers learn languages because of success stories by other companies—not by the merits of the syntax or one-off tricks like compiling itself in 5 seconds. The fact that Firefox uses Rust for the browser engine or that Dropbox uses Rust for the sync engine is the kind of thing that gets me interested.

Are you implying that D is slow at compiling regular code but fast at compiling itself, because of some cleverness? Is that actually true?

I'm not saying that at all. But looking at a feature matrix or hearing from a fan what the great parts of a language are isn't enough to convince me to adopt it.

If it's been around for 2 decades and hardly has any adoption by large companies[0] I personally am not willing to learn it (unless that changes).

I'm not necessarily using adoption as a proxy for quality either. If there isn't any meaningful adoption it's not like I can join a company to write it or have an easy time convincing my manager to try it. It could be the greatest language on earth but if I can't write it then it doesn't matter.

[0]: https://dlang.org/orgs-using-d.html

Re: Ask HN: Why do you use Rust, when D is available?

#24

Because Rust is new and shiny. People who use Rust aren't using it to solve real world problems, they're using it to scratch a novelty itch. D is a tragedy in my opinion. It's an excellent language that just doesn't fit the political needs of any of the big players. We have Swift which is a worse version of C#, we have Go, we have Java. Why don't we have a single language so that we can do cross platform development…

> Why don't we have a single language so that we can do cross platform development

We do, we have dozens of them, C, C++, java, ruby, python, c# to name a few. We have at least a half dozen cross platform GUI toolkits to go with them, Qt, Gtk, swing, wxWidgets, tk. Pick whatever poison you want, they're all much better than electron.

I suspect you're right about rust though, something newer and shinier will come along soon, if it hasn't already.

Re: Ask HN: Why do you use Rust, when D is available?

#25
Phobos/Tango. GC, then optional-GC. Compiler support for various platforms was wonky, never sure if I was using the right one.

D as of now is a worthy competitor to Rust, it wasn't always the case, it was more like Go, with the GC. I hit some snags and moved on and didn't go back. I am sticking with Rust.

I think a question with closer alignment is, "Why use Go when D is available" ? D feels like a 5x better Go, not a Rust competitor.

Re: Ask HN: Why do you use Rust, when D is available?

#26
post #25

Phobos/Tango. GC, then optional-GC. Compiler support for various platforms was wonky, never sure if I was using the right one. D as of now is a worthy competitor to Rust, it wasn't always the case, it was more like Go, with the GC. I hit some snags and moved on and didn't go back. I am sticking with Rust. I think a question with closer alignment is, "Why use Go when D is available" ? D feels like a 5x better Go, not…

Why did go took off then?

Re: Ask HN: Why do you use Rust, when D is available?

#27

I know most people won't like this answer but the reason why rust is more popular now is because it had klabnik-san, mozilla, cargo and the super excited community. The same goes for go-lang. It throws away years of research into programming languages. While rust is a great language and deserve the popularity, do you think go would have peaked in popularity if there weren't rob-pike-san and google behind it. It's not…

I'm pretty sure I agree with everything you said but I don't see it as a bad thing. PR/marketing (for lack of a better term) might be outside of a language initially but those efforts lead to things like making cargo really good—and it is.

I think it's good for thought leaders to rally people around new ecosystems: excitement breeds innovation. I don't think programming languages need to move to the scientific method and double-blind testing.

That said, you never outright said that it's bad. I'm inferring that from your choice of words.

Re: Ask HN: Why do you use Rust, when D is available?

#28
Personally, at some point Rust was just clearly better and after a while - I lost interest in D. I don't have time to keep track of D catching up, when I'm so happy with Rust, and ecosystem is growing so fast. Maybe D got much better in last few years... but I kind of don't care anymore. It's hard enough to introduce a raising star like Rust to your coworkers and D just don't have traction anymore.

I've been following D since early 2000s. 2 decades. It took it a long time to get good: make it open source, make it community driven instead of one-man show, add some really important features and focus on important things (ownership, memory-safety), get the tools to be good.

It just missed the boat, and never really had a right niche for itself. It was kind Java/C++ mix, and it wasn't all that better to dethrone anyone in that space.

Rust swooped in and executed everything perfectly in a really short time. It's a C++-killer: same strengths, none of the weaknesses. Normal people don't want to touch C++ anymore. Only people that think that CVEs are "just fault of bad developers" (LOL) can still be considering C++ a good language to start new projects in. Industry really, really needed C-like language that was memory safe, and all-round good: both low and high level. And Rust quickly delivered that, borrowing all the great aspects of other languages and addressing a lot of problems.

D is great, and I like it far more than e.g. Go, but it was an ambitious project by one individual for a long time, while Go had a whole Google behind it. There's no shame that it didn't "took over the world". Rust would possibly not do so well if it wasn't for Mozilla support. The marketing, credibility and traction a big backing company like this gives a new language is probably the single bigger reason for different outcomes.

Re: Ask HN: Why do you use Rust, when D is available?

#29
As far as I know, D does not have ADTs (algebraic data types, a.k.a. tagged unions, a.k.a. Rust enums). I see that it has "enums" and "unions", but neither of these appear to be ADTs if I'm reading them correctly.

And Rust's borrow checker can give very strong guarantees that aren't present in any other mainstream language that I'm aware of. In Rust, you can pass mutable references to large data structures between threads, without copying or GC or any type of runtime checking (e.g. Mutexes), and the borrow checker will guarantee that you can't have a data race (data race = concurrent read & write). In comparison, I believe that in Haskell you'd do this with GC, in Java you'd do it with GC and a mutex, and in C you'd do it very carefully.

As another example, in Java if you modify an ArrayList while iterating over it, you'll get a ConcurrentModificationException. In Rust, you can't. The borrow checker won't let your program compile.

The cost of this borrow checker is huge: every reference in every program needs to be annotation with whether it's shared or mutable, and you often need to splatter confusing lifetime annotations all over the place. It adds a big learning curve to the language.

I don't know the details of D's ownership system, but it's not like Rust's borrow checker. Does someone who does know more want to describe it? I've just seen the language reference page here, that describes "scope" and "returns". https://dlang.org/spec/memory-safe-d.html

Re: Ask HN: Why do you use Rust, when D is available?

#30
post #16

Earlier quoted context omitted.

So your solution for there being to many languages is for somebody to create one more. And the main thing you want from that language is that it have no corporate sponsorship, such that whoever creates it will have to bear the financial burden personally.

Look no further than Clojure to see that it can be done. And I offer that as a 100% neutral statement.

Kinda. Clojure peaked interest around 2015 and has been declining ever since.

I think if it wasn't tied to the JVM ecosystem, it probably would have seen a lot more success outside of server side stuff. The long bootstrapping startup really is a killjoy. Then again, a lot of the type that made it popular in the first place came from being a part of the JVM ecosystem.

Post reply on HN