Given the choice, I would rather use D, because experience has taught me that tracing GC are a productivy boom, even in systems programming, also D provides all the necessary tooling for doing GC free programming when required to do so. However it lacks the commitment of a proper roadmap and big corporate support, and that sadly damages its image. Rust on the other hand, while quite relevant for bringing affine types…
Ask HN: Why do you use Rust, when D is available?
211–220 of 262 posts
Re: Ask HN: Why do you use Rust, when D is available?
#212I remember how about 5 years ago I researched what new language to take on. I was in an unusual position to not consider job availability since I planned for a long game and was primary interested in growing my basic coding skills. It narrowed down to D, Go, Nim and Rust. Rust won on paper based on C-like performance without GC and being not OOP-oriented in a Java way (I tried Java earlier and wondered who in his rig…
> Go [...] there was not much I saw the language could teach me Interesting that you mention this; one of the reasons I really enjoy Rust is because of how it forces me to think through things more clearly, and how a number of the higher-quality crates teach more advanced approaches in a straightforward way.
Re: Ask HN: Why do you use Rust, when D is available?
#213Given the choice, I would rather use D, because experience has taught me that tracing GC are a productivy boom, even in systems programming, also D provides all the necessary tooling for doing GC free programming when required to do so. However it lacks the commitment of a proper roadmap and big corporate support, and that sadly damages its image. Rust on the other hand, while quite relevant for bringing affine types…
Is there much choice though in terms of jobs? I mean, is it worth learning D vs rust? I'm actually thinking about that nowadays, for what to learn next..
https://dlang.org/orgs-using-d.html
So if getting a job is your major learning motivation, then I guess Rust has definitely the edge there.
Re: Ask HN: Why do you use Rust, when D is available?
#214Personally, 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 followin…
I’m currently trying to get into robotics. But why does everyone want c++? Surely robots can be programmed in other languages.
C++11 is a really good language. Also there are tons of libraries and things people have already built in it that you can leverage to reduce development time.
Re: Ask HN: Why do you use Rust, when D is available?
#215Earlier quoted context omitted.
> But why does everyone want c++? Few "want" C++, but for robotics a non garbage-collected language is necessary so latency is predictable. There are few mature languages besides C/C++ in that category. Rust is an improvement, but I'm hopeful something like Julia (Julia Robotics, https://juliarobotics.org/ ) or Scala Native ( https://scala-native.readthedocs.io/en/v0.3.9-docs/ ) becomes mainstream, the productivity g…
Garbage-collected languages can have (and some have had) latency-predictable GCs. It's not entirely an either/or, it's something of a false dichotomy. "Non-garbage collecting" languages blur the line anyway because even basic things like reference-counting are still a garbage collection technique. The trade-offs are in how many control knobs and where those knobs are/how you turn them, and a lot of developers still s…
For 99% of realtime work, the Rust or Scala Native approach is just fine. No GC required. Julia users can just use the pre-allocation approach.
The important thing is avoiding language patterns that encourage needless allocation.
Re: Ask HN: Why do you use Rust, when D is available?
#216Earlier quoted context omitted.
Also D has a gcc backend. Which is nice but it's still missing some of Rust's features.
Its more than that. D is part of GCC - The GNU Compiler Collection. Meaning that if you use linux and have recent GCC you already have D compiler.
Re: Ask HN: Why do you use Rust, when D is available?
#217As 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 th…
D's borrow checker is only semi-documented/WIP at the moment. https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in... Basically D just needs that big break to actually get things done. There are some absolutely brilliant people working on D but there's only so much sweat people will donate (some people are paid but I imagine rust probably has upwards of a hundred full time staff given that Mozilla and Microso…
Re: Ask HN: Why do you use Rust, when D is available?
#218Re: Ask HN: Why do you use Rust, when D is available?
#219Earlier quoted context omitted.
The reason behind putting the type after the variable is that the resulting syntax plays way better with type inference. Scala is a clear inspiration for Rust in that regard.
(Let me nip a little here). Looks like not only Scala inference types but also its compile times too migrated into Rust.
In any case, as a Scala dev, I wish the compile times were as short as in Rust!
Re: Ask HN: Why do you use Rust, when D is available?
#220Earlier quoted context omitted.
Rust is much better at caching the intermediate results of compilation. First time compilation might take some time, recompilation will be faster though.
cargo doesn't do a terribly good job of caching dependencies. Might be better than whatever C++ does though.
Then most organizations have staging areas where you can share binaries across the company.
And the two package managers that have been growing community support, conan and vcpkg, support caching and distribution of binary dependencies.
No doubt cargo will eventually get something similar, it just isn't there today.