13 ms·
Any reasons D never caught on more? No big tech company anchor behind it?
by fnord77 5y ago
Any reasons D never caught on more? No big tech company anchor behind it?
- gher-shyu3i 5y agoChallenging to overcome languages like C++, Rust, Java, and C#. D seems to sit somewhere in between, a better C++, but with (optional) GC. The thing is, Java and C# are already making strides into that space.
- FraaJad 5y agoI am curious to see where Java are C# are making progress towards optional GC. This specific article talks about using No GC aka "betterC". D has GC by default; the use of GC is convenient and mainstream as most popular languages show - Java/C#/Python etc. What D gives is the unique ability to do No GC programming for the cases where GC is not desirable. Very few languages offer this capability. Zig is interesting in this arena, but it approaches the problem from the other angle. It is manual memory management by default, but you can explicitly choose which memory management technique you want to use - at compile time.
- vips7L 5y agoC# has added a lot of control over memory layout. Span [0], structs etc. I am hoping they add more D like features (@nogc) to the language. Java itself has just made strides on reducing GC pause times [1]. Granted, this isn't optional GC, but does D really give you that? Don't you lose the entire ecosystem and stdlib with -asBetterC? Why would I choose that over rust/zig/c++? FWIW, I am a big fan of D. [0] https://docs.microsoft.com/en-us/archive/msdn-magazine/2018/january/csharp-all-about-span-exploring-a-new-net-mainstay https://docs.microsoft.com/en-us/archive/msdn-magazine/2018/... [1] https://malloc.se/blog/zgc-jdk16 https://malloc.se/blog/zgc-jdk16
- aldacron 5y ago> Granted, this isn't optional GC, but does D really give you that? Don't you lose the entire ecosystem and stdlib with -asBetterC? -betterC is not the only way to avoid the GC in D, just the most extreme. The original motivation for -betterC was to ease porting C code to D. Walter has used it for that to port a good bit of his old C code over. But it's also suited for the space in which the blog author is using it, and some people just prefer it. You always have access to the existing C ecosystem, but there are people writing -betterC libraries in the D ecosystem. And as more people use it, I expect that space will grow.
- pizza234 5y agoIf one sets the requirement of having manual memory management in a mixed language, then: 1. either they don't use any library, including the standard one, 2. or the (standard) libraries must be written in both manual and managed memory management versions. Additionally, the language must include extra syntax for memory allocation and access. This doesn't event include safety-related semantics, like Rust, which would be very hard to bolt-in (language-wise). I hardly see any advantage in Java/C# having this functionality; Oracle is actually putting lots of effort into improving their garbage collectors. Java does actually have manual memory management (through Unsafe), although it's rudimentary; for the reason mentioned, I doubt it will ever be improved/expanded.
- tzs 5y agoD was released 9 years before Rust, making it unlikely that rust had much influence on D adoption.
- bachmeier 5y agoThis is Hacker News.
- echelon 5y agoBack when D originally debuted, I couldn't separate it in my mind from C# and Java, despite the fact that you could manage your own memory. It felt like it fit into the same space, yet didn't have a compelling ecosystem. (Competing standard libraries did not help their case!) That's at least why I glossed over it.
- pjmlp 5y agoJava and C# also offered similar capabilities when D appeared. Granted on Java side it required sun.misc.Unsafe, JNI or Real-Time JSR, while on C# side, a mix of structs, SafeHandle, MarshalInterop, unsafe and eventually C++/CLI. So while not as pleasant as D, the cost to drop those eco-systems wasn't worth the cost to switch, and now 10 years later those eco-systems have doubled down on improving the experience for low level coding. This makes it quite hard to sell D to those potential users.
- valenterry 5y agoHonestly, I believe it is much more about marketing than one might expect.
- andrewflnr 5y agoHa, only unexpected if you haven't been watching how every other language adoption goes. Otherwise I agree. :)
- MaxBarraclough 5y agoAgree. I think this is one of the reasons Ada has seen (and continues to see) so little use.
- pjmlp 5y agoComing from the Pascal side of programming, the syntax doesn't help to gain adoption in hacker community that grew out of UNIX culture. In a way I think it is a kind of revenge that most newer languages adopt Pascal style variable and type declarations.
- NationalPark 5y agoThat's kind of an uncharitable way to say, "Rust has a welcoming and beginner-friendly community". It's not like there's a marketing team buying Facebook ads.
- hu3 5y agoRust had Mozilla blog posting about it for a long time. https://hacks.mozilla.org/2016/07/shipping-rust-in-firefox/ https://hacks.mozilla.org/2016/07/shipping-rust-in-firefox/ Let's not pretend marketing is just paid Facebook/Google ads.
- Zababa 5y agoI think that's your vision of marketing. Marketing by word of mouth because you really like a product is still marketing, and the Rust community is really good at that. The Rust community realized early that if they wanted to succeed, they had to talk about Rust a lot, show good examples, be beginner friendly to avoid people picking it up and dropping it quikly. But that "marketing" is also things like a really good package manager, really good compiler errors, a really good VSCode extensions. Many communities don't have this (especially the new ones) and this makes developing in Rust more of a joy than in let's say OCaml or even JS.
- crazypython 5y agoSymmetry Investments, a $4.5bn assets-under-management hedge fund, sponsors Dlang. No major tech company behind Dlang.
- nicoburns 5y agoNot different enough to be worth switching from Java/C++ with their much bigger and more established communities. This was especially true earlier in it's history when it required GC. Now it doesn't, but it has to compete with Rust which can also offer memory safety.
- bachmeier 5y ago> Not different enough to be worth switching from Java/C++ with their much bigger and more established communities. Companies using Java or C++ don't switch because a language is "sufficiently different". I've been involved in programming language discussions for decades and I've never heard of a company switching to a language because it was different from what they were already using, though being too different is a common reason for not switching. {For those not aware, D has intentionally kept compatibility with C as a priority, to the point that you can set a compiler flag and restrict yourself to "betterC". You can translate C code to D without making many changes to it.}
- mhh__ 5y agoThe D compiler speaks C11 now, it'll be ready for prime time in two or three releases based on speaking to Iain and Walter.
- WalterBright 5y agoJust added C11 anonymous structs last night!
- mhh__ 5y agoI saw, as long as the code stays clean I think we're going to be kicking ourselves this only happened now.
- WalterBright 5y agoSo far, it's shaping up nicely. I am indeed kicking myself for not doing it a while ago, but I'm a better programmer now than then, and it's going to be a better job.
- Diggsey 5y agoI used D for a while. It improves several things over C++, among them: - More powerful metaprogramming capabilities. - Better module and library system. - Nicer syntax. The problem IMO is it's just not enough to justify a total move from C++ -> D. The syntax of C++ can't really be fixed, but the other aspects can be improved without a new language. Furthermore, many of the other downsides of C++ are still present: - The complexity of the language, and then the sheer number of different ways of doing the same thing. - Some pretty dark corners in the way stdlib/language feature were implemented that seemed hard to ever fix. - The way behaviour is specified in the language is very tied to the underlying hardware: rather than explicitly describing behaviour in terms of an abstract machine, it works more in the way C++ is specified where we all know it operates on an abstract machine thanks to compiler optimizations, but the spec likes to pretend it doesn't... And then there are problems that are introduced by D, such as the fact that a safe subset exists, but depends on GC, so there's a weird split where no "safe code" can be used in contexts where GC is unsuitable. Contrast this to Rust, where: - There is a true step-change in bringing safe code to all contexts, not just those where GC can be used. - It's missing a lot of the complexity of C++. Rust is hard because it has concepts that are foreign to a lot of programmers, but the total number of features is low (compared to C++) so there are fewer surprising ways they can interact. - Rust is a suitable replacement for C, not just C++, because it's not just adding more features.
- mhh__ 5y agoThe idea that Rust is suitable to replace C and D isn't is odd to me. It's really not hard to do + we (unlike some languages, not sure about rust) actually test on embedded targets via GCC.
- Diggsey 5y agoWhat I meant by this is: if you are starting a project today, and have to choose between C and C++, there are certain reasons why you might choose C over C++. Those same reasons would apply for choosing C over D. They might not apply for choosing C over Rust.
- 5y ago
- mhh__ 5y agoThe things that make D special - culturally even - are quite niche so while it's been extremely profitable for many who do use D, D is sometimes not an easy sell in the sense that the things that D makes easy are not things you encounter in the first few minutes of using a language. Also: Marketing, a lot decisions are made based on nothing, we're too modest (to be blunt).
- systems 5y agoAs far as I know D's original design strategy, was to be a simpler to use C++ with a GC, but with the same expressive power Over time, this proved to be a bad strategy, C++ key strength became RAII (deterministic memory management), so the GC became a failed strategy The maintainers tried to move in different directions, adding manually memory management, making the GC optional, moved D to be a C replacement, with the -betterc compiling option, and many other tweaks and features added overtime, but nothing really caught on
- mhh__ 5y agoThis isn't a very good summary of how the language evolved. D has basically always had the ability to not use the GC, it's only recently that we've taken an interest in replacing C. The GC has been written in D for a very long time, that wouldn't be the case if the language didn't allow manual memory from day 1. BetterC is a nice-to-have rather than a language dialect. Having a GC is an absolute godsend for getting clean code out of the door quickly.
- Zababa 5y agoWould it be fair to say that for some time (I wouldn't know exactly when it started) D has evolved to serve the needs of the D community rather than to attract new people?
- mhh__ 5y agoAttracting new people is basically never (with exception of the C stuff) been the driving force behind efforts influencing D's design. Another anecdote - Someone who hires people in D has told me definitely that D being small means that hiring for them is usually just seeing some code, i.e. there hasn't been an eternal September let's say. They can onboard people who don't know the language, but knowing D is a very good cultural (programming is easy!) filter.
- Zababa 5y agoThanks, that's interesting.
- pizza234 5y agoUltimately, for any language to become popular, it must bring something radically new on the table (e.g. Java: relative performance, simplicity and safety; Python: immediacy; etc.), and/or have a big company behind. D doesn't have any of the two (unfortunately! I do appreciate the language). This viewpoint is typically represented by the question "what can I do in X that I can't in C++?". Something I personally find interesting is the thought experiment: if Golang was written by a small actor, and D by a big one, which one would have succeeded?
- AnimalMuppet 5y agoI don't know that it's essential that a big company be behind a language. What's essential is that the tooling and the libraries be top-notch. That's beyond the reach of an individual, or even a small team. But a large company can easily provide the resources to do that. (The third essential is that a language do something significantly better or easier than existing languages. A language can't just be "does the same as C, but with a bit different syntax", unless it's radically better syntax. Switching languages has a cost; your new language has to pay back that investment or it won't get used.)
- andai 5y agoI can't remember where I heard this, but there's a principle that a competing product can't just be 10% better. To justify the cost of switching, it has to be 10X better.
- Corazoor 5y agoCertainly not the sole reason, but the mix of language features puts it into a weird spot: You have great control over memory layout and can easily embed assembler, which would be perfect for performance sensitive software like games. Yet "default" D comes with a garbage collector and - more importantly - language features that require said GC. If you want to go the noGC route, you have to refrain from using certain language constructs, which puts you in a similar spot as with C++... And if you actually want a GC, you might find the simple linear allocator of D to be lacking... D is a very cool language, but it is also a lot like QTified C++... Which, well, already exists...
- mhh__ 5y agoI'm surprised you mentioned memory allocation without spotting the memory allocators in the standard library. Andrei designed the library and as far as I can tell no other language comes close when it comes to composable allocators.
- Corazoor 5y agoI dunno why you assume that I don't know about them... Apart from that, they came pretty late, are still in experimental, and don't change the fact that only a subset of D is usable without GC. I very much like D, I really do, but I never encountered a usecase where the pros of using D outweight the cons. It sits in a very very weird spot design-wise, and while Walter and Andrei tried their best to get rid of the most common problems, not much of that effort resulted in actual useful change: Still no other GC than the default linear one, the stdlib is still not fully noGC usable (and probably never will), and "proper" compile time functions are still not done, after quite a few years now... Which is a shame, D is very close to being the perfect C++ replacement.
- WalterBright 5y agoIf you don't want to use the GC, why the concern about its implementation? I have no idea what you mean by "proper" compile time functions. D's CTFE is excellent.
- 5y ago
- CyberDildonics 5y agoI think there are just two big factors - garbage collection and tools. When it was made garbage collection seemed reasonable, but with modern C++ and rust we now know that tracking ownership through different scopes solves the same problems very well with none of the downsides of garbage collection. If you look at D, Julia, C#, Java, Ocaml, etc. etc. over and over you see people eventually fighting with the garbage collection over throughput and latency. D to my knowledge has never fully transitioned to garbage collection being a thing of the past. For tools I think D fell into a common trap, which is to just keep working on the language itself. Eventually the lack of debugger, real time syntax checking and auto completion take their toll and something like C++ seems better even with the rough edges of the language itself.
- TheCondor 5y agoA lot of people have mentioned a lot of reasons, marketing, corporate support, etc... I think a language technology needs at least one, but ideally a few, flag ship projects using it. It provides some examples for people to see, it shows the "why" and then it also connotes that it's living and good. I don't think it has to be big, just good. Ripgrep is a prime example, there are a few other smaller tools in Rust that are nice, well put together tools that do a nicer or better job than the old standards. You can talk about why something is nice or better, but actually showing people that it is probably convinces more.
- skocznymroczny 5y agoIt's trying to please C++ fanboys too much, who then get outraged about some other D feature and go back to C++ again.
- whatmyjg 5y agoD chose GC.
- tastyminerals2 5y agoPlenty of great answers above already. What I also think is a valid argument is that in order to appreciate the language, one has to be a seasoned developer hence many heated discussions on HN or Reddit. It reminds me of Lua, where at least one person would mention something about 1-index arrays and nil element behaviour.
- Doxin 5y agoI feel like a large reason for that is that D is a properly boring language and I mean that in the best way possible. I have yet to be unpleasantly surprised by D in the way other languages seem to be specifically designed towards. While this makes D a deeply pleasant language to use, it also makes it tough to sell. It doesn't have any whizz bang features you can get across in an elevator pitch.