13 ms·
I have wondered for awhile now why Rust is getting all this attention of being "Like C but safe and cool!", but no one would mention D. I personally don't do s
by tombert 8y ago
I have wondered for awhile now why Rust is getting all this attention of being "Like C but safe and cool!", but no one would mention D.
I personally don't do systems programming because I'm not smart enough but the little bit I have done, I found D to be the most-natural feeling (even over Rust), and D has been around a lot longer.
I suppose timing is everything for these kinds of things.
- nwah1 8y agoD had a closed source reference compiler for a long time, and didn't have any major backers. Rust had Mozilla backing early, and was fully open and transparent in terms of community feedback, and wasn't just making a language that had high level features, but was pioneering a new category of language that added tons of safety guarantees at compile time by default using a new paradigm of enforcing borrowing and ownership. These safety guarantees are not just in regards to memory safety, but also in regards to data races. D seems to allow memory safety guarantees, but not by default, and I believe it is enforced at runtime not compiletime. So Rust was at once more accessible and more exciting.
- tombert 8y agoThat's fair, I suspected that people who knew more about this stuff had a reason.
- jordigh 8y agoD's compiler was never "closed source" if by that you mean "source not visible". It had a weird non-open source license for a long time, but the source has always been visible. The weird license did use to scare me away, but that's very much a thing of the past now and now it has a standard free license. https://news.ycombinator.com/item?id=14060846 https://news.ycombinator.com/item?id=14060846 I don't think D's features are any less exciting than Rust's, but Rust has had a lot of RESF backed by Mozilla.
- ryan_lane 8y agoSource code being visible doesn't make it open source. It had a personal-use-only license, which isn't a valid OSSI license (which is what makes something open source).
- jordigh 8y agoThat's why I qualified it with "if that's what you mean by closed source". I don't know if all source is either open or closed and anything that isn't OSI-approved is closed. I don't think that's what people usually mean by "closed source". I also freely granted that dmd's ad-hoc license wasn't open source despite having visible source.
- p0nce 8y agoCompiling slower than C++ is not exciting.
- FraaJad 8y agojust to be clear, p0nce is referring to rust's compile time. D is known to have very fast compile times (unless you are doing very template heavy meta programming..)
- always_good 8y agoLooking at your comment history, it's clear that you're a D-fanatic. But let's not use your enthusiasm for D as a point against any language that D competes with. It's impossible to turn that into a real discussion.
- WalterBright 8y agoD's only runtime memory safety feature is array bounds checking. (The same as Rust, I believe.) The rest is compile time. D's compile time memory safety focusses on: 1. @safe and @system code 2. disallowing unsafe pointer operations 3. safe alternatives to pointers 4. controlling escaping of pointers 5. controlling the scope of addresses
- SamReidHughes 8y agoRust has other runtime memory safety checking, like RefCell.
- Paul-ish 8y ago> D had a closed source reference compiler for a long time, and didn't have any major backers. In addition, wasn't there for a while two separate and incomparable versions of the standard library that fragmented the community?
- alphaglosined 8y agoThat was 9 years ago and the second is no longer maintained (for about 2 years at this point).
- z3t4 8y agoThe Rust community is extremely hostile, especially against other languages, and D in particular.
- steveklabnik 8y agoWhere do you see that happening? I'd love to tell some people to cut it out!
- z3t4 8y agoIn this post about D, the top comments are about how great Rust is. But mentioning D in a post about Rust is like sticking your head into a bee-hive.
- steveklabnik 8y agoThe top comment is about how much they love D, and wonder why others don’t. So people are answering that question. I don’t see how that’s the Rust community hating other languages, but answering a question about preference. They’re all respectful answers. I don’t see it here, sorry :/
- tombert 8y agoReally? The few times I've used Rust, the people on the IRC channel were really nice to me and helped me get bootstrapped.
- DeepYogurt 8y agoIn my experience the rust community has been incredibly welcoming and nice.
- pjmlp 8y agoNot at all, they even put up with my schizophrenic arguments of C++ vs Rust vs whatever.
- z3phyr 8y agoIts not hostile. Its aggressive in selling the strong points of the language. Having said that, I do wish newer languages spring up that adapt the good stuff from Rust. I can never like Rust syntax.
- nonsince 8y agoThe main reason the way I see it is that a lot of people who still use C and C++ need maximum speed, and D is only memory-safe with its garbage collector enabled. This affects latency and adds overhead. For many cases using a garbage collector is fine, but D was trying to target video games and other spaces where the GC was not acceptable. So D allows you to turn the GC off, but then it's just a vastly less-mature C++ with similar safety footguns and worse library support. Rust actually fills a space that wasn't filled by anything else - memory safety without a garbage collector. You can write pretty ergonomic code in Rust (similar to how code would look in a dynamic and/or GC'd language) just like D, but where in D you would have to choose between highest-possible efficiency and safety, Rust gives you both at the same time. This isn't to say that Rust is better than D, but it is to say that Rust targets a gap in the market whereas D is trying to have the same tradeoffs as C++ but be better, which is nowhere near as compelling for most developers who've invested a lot of time into learning C++. C++ developers don't use D for the same reason that most people don't switch from qwerty to dvorak even though it's technically more efficient. It's not such a qualitative change that it's worth the retraining.
- pjmlp 8y agoOn what concerns video games, all major engines do use GC on gameplay code, including variations of C++ GCs.
- jdright 8y agoemphasis on gameplay code. And even there, if you target 60fps (sure a minority of developers), then GC is a liability at best.
- pjmlp 8y agoBut that is exactly the point. One should not constrain productivity just based on hypothetical goals, web scale and such similar arguments. Doing the next Fortnite, Crysis or ground breaking AR/VR/Ray Tracing? Sure, every ms/byte counts. Doing a typical Flash like casual game, game prototypes at Ludum Dare, participating at IGF? Having a GC around isn't the biggest concern.
- josefx 8y ago> I have wondered for awhile now why Rust is getting all this attention of being "Like C but safe and cool!", but no one would mention D. D is still build around a GC so it doesn't really fit into a discussion about GC free languages. Unless you want to focus on its "better C" subset, which I think puts it at a disadvantage compared to any language not fundamentally designed around the presence of a GC.
- alphaglosined 8y agoNah, -betterC gives you an advantage over C. It isn't meant to give you an advantage over languages like C++. Its in the name after all ;)
- WalterBright 8y agoYou can use -betterC and link with C++ code, too.
- grpsisgood 8y agoBecause there is no big company behind D. Rust isn't good as boasted. But firefox and HN willing to blow the bubble. That's their company's strategy.
- youeseh 8y ago> Rust isn't good as boasted What do you mean? What's being boasted about Rust and what makes it untrue?
- Asooka 8y agoI can identify several traits that helped Rust be more marketable over D. First is that Rust is making tooling a central issue they're working on. Right now you can install VSCode and get a Rust plugin with a single click or get a VisualStudio plugin with a single click, and that gets you intellisense right away. I'm pretty sure that Rust's editor tooling has reached and surpassed D's in a comparatively tiny timeframe. Second, Rust comes with an opinionated build system and module system out of the box, while D just has a compiler, you need to figure out building yourself and use a separate package manager. This is something you would be very comfortable with if you're a C/C++ programmer, but not so if you're using pretty much any other mainstream language. These days it's expected that the language comes with a compiler, build system and package manager. Third, Rust is more novel, thus more interesting. It's a new language combining new programming paradigms in a novel way. Go has channels and goroutines, Rust has the borrow checker and zero overhead compile-time memory safety. D has... it's trying to be a better C++. It's succeeding very well, but its features aren't exciting. In conclusion, Rust has come out the gate with great marketing, with novel and interesting features not seen before in a system programming language, and with great tooling support for the current generation of developers who don't want to bother with learning arcane Makefiles (or CMakefiles as the case may be today). D is just a better C++ with the same friction to use as the language it's trying to replace, but without the top-notch tooling that exists for C++. Rust on the other hand also doesn't have tooling quite as good as C++, but it's not replacing C++ in existing projects, it's used for new projects. One case where D significantly outpaces Rust is in its ability to interface with C++. This gives it a significant edge in being considered for use in C++ projects, and I would expect that there are many cases of mixed D and C++ usage among the D success stories. Rust's lack of C++-compatibility story (I will be interested to hear how Mozilla integrate it with their C++ code!) is really what's holding the language back for my use-cases. The C ABI may be the lingua franca of low-level code, but a significant amount of native code is written in C++ and I need to interface with it natively via the platform's dominant C++ ABI. D would really shine in mixed C++ projects, but it really needs a turnkey solution for intellisense integration, i.e. better tooling. It would also need seamless debugger integration, letting me trivially step through D, C++ and C code in a mixed setting, and letting me place breakpoints, watch memory, etc.
- 8y ago
- scott_s 8y agoRust brought something new that no other language had: memory safety through statically enforcing object ownership and borrowing. Anyone who has done manual memory management already is familiar with those concepts, and how difficult that can be to track in large systems. Whenever a language is able to abstract pervasive concepts to first-class entities in a language, it becomes attractive to people who deal with those concepts on a regular basis. D, from what I am aware of, did not offer any new abstractions. Rather, it was an attempt to do all of the existing abstractions in a better way. Which is laudable, but it can be hard to convince people to switch to a language when it offers only iterative improvements.
- alphaglosined 8y agoWe are working on improving scope atm which is quite an improvement. Tieing exceptions into it too to remove allocations.
- carlmr 8y agoI'm excited for Rust because it might be finally time for a better safer embedded language (no GC is basically required here) and I like using it for little tools where I process huge text files. Zero copy (in a safe way) makes everything super high speed.
- skocznymroczny 8y agoD is in an awkward spot. C++/Rust folks dislike it for using a GC. Java/C#/Javascript folks dislike it for being too C++ like with pointers, templates and all. The people who use it don't care about language wars and just enjoy their tool.