6 ms·
D’s Newfangled Name Mangling
- imh 9y agoD seems like a cool language. Do many people use it?
- eco 9y agoThere are download stats for dmd, the reference compiler[1]. Anyone doing production work is probably using gdc or ldc though so that's not the whole picture. They have an orgs using D page: https://dlang.org/orgs-using-d.html https://dlang.org/orgs-using-d.html If you look at the various language rankings (taken with a mountain of salt) D is still fairly low overall. Definitely one of the higher languages without a corporate/industry backer though. 1. http://erdani.com/d/downloads.daily.png http://erdani.com/d/downloads.daily.png
- k__ 9y agoI only know about FB.
- earenndil 9y agoNetflix is also using it.
- systems 9y agoFB seem to have stopped using it, they no longer have active D projects on github
- nicwilson 9y agoSee https://dlang.org/orgs-using-d.html https://dlang.org/orgs-using-d.html see also https://dlang.org/areas-of-d-usage.html https://dlang.org/areas-of-d-usage.html
- pjmlp 9y agoAt least these ones do, you will find a few well known names. https://dlang.org/orgs-using-d.html https://dlang.org/orgs-using-d.html However the development is mostly community driven, there is no big sponsor around, like other more widespread languages.
- maxxxxx 9y agoD is an interesting case study for good technology somehow not succeeding. The people working on it are very good and it's a really interesting language. In theory it should slowly have taken over from C++ but for whatever reason this didn't happen.
- ionforce 9y agoWhat are some prevailing opinions on why it did not succeed?
- bachmeier 9y ago> why it did not succeed? Don't you mean "why it has not succeeded yet?" To some extent, I'm inclined to ask what you mean by success. It's a great language, it has three compilers, it's making progress, and it's possible to have fun writing fast, correct code quickly. It's been more successful than any other language as far as I'm concerned. Most likely you are asking why it hasn't seen widespread usage in the enterprise (like half of C++'s usage). That's a very high standard. Cost-benefit analysis usually leads to using established languages because there are benefits. D doesn't even have a very good IDE situation (I've been told), only recently got a package manager, etc.
- earenndil 9y agoEh, it only really has one compiler. DMD, LDC, and GDC all use the same frontend, they just interface to different backends (DMD, LLVM, and GCC).
- geezerjay 9y ago> Don't you mean "why it has not succeeded yet?" No, OP got it right. D had a shot at success while C++'s standardization process remained stagnant, and D could pick up the slack as it wasn't bound by backward compatibility requirements or the need to update a standard. Once ISO 14882:2011 was approved and C++'s standardization effort gathered speed, D lost the only competitive advantage and lost its chance at relevance.
- jordigh 9y agoCurrently, about as many as those who use Rust, although going by hype, Rust seems to be getting a lot more attention (i.e. larger derivative of the usage curve, perhaps?). If you look at usage on github, there's quite a bit of D code for such a niche language. I've been doing Advent of Code in D, and I'm having a blast: http://inversethought.com/hg/aoc/file/tip/2017/ http://inversethought.com/hg/aoc/file/tip/2017/ I particularly enjoyed doing day 18, which required doing message-passing concurrency (or at least simulating it) and D's concurrency primitives fit the problem like a glove: http://inversethought.com/hg/aoc/file/tip/2017/day18.d http://inversethought.com/hg/aoc/file/tip/2017/day18.d
- steveklabnik 9y ago> Currently, about as many as those who use Rust How do you get these numbers? To be clear, I'm not saying you're wrong, it's just that this is really hard to do, and I'm always curious how other people do it.
- jordigh 9y agohttp://githut.info/ http://githut.info/ Hm, although I think my estimate is already outdated? It seems like Rust has picked up a lot of steam in the past six months or so.
- steveklabnik 9y agoAh: GitHut.info Carlo Zapponi 2014 So yes, very outdated. I wish they kept this up-to-date! It's one of the more interesting metrics.
- nitely 9y agohttps://madnight.github.io/githut/ https://madnight.github.io/githut/ This one seems up to date
- steveklabnik 9y agoOh this is excellent!
- katastic 9y agoI freakin' love it. I could write pages about each of the features I use and how applicable they are. C++ is (literally) around a decade behind D, and takes the best features D already had... for ten years or longer. Better templates. Modules. Unit testing built in. Universal function call syntax. And tons more. I use almost all of those features every day. It's not perfect, there "are" flaws. But nothing horrific. It's also "C++ + 1" so any C/C++/variant programmer can pick it up over a weekend. I genuinely "enjoy" writing D code now instead of all the boilerplate C++ comes with. Things are progressing and eventually I'm going to release a game to Steam with D.
- mml 9y agoD is indeed interesting. Wrote some experimental code this fall, was fairly happy with it, but wound up going w/ rust.
- stochastic_monk 9y agoI feel like D would fight with Go in the realm of things I'd use it for, in which case I'd pick it. On the other hand, D supports a lot of great C++-style stuff, but I'd never pick it in that regime because it'd be the same amount of effort without as-fast-as-possible.
- nicwilson 9y agoI find that D is far less effort to write equivalent functionality then C++ with reasonable perf. See the links in https://forum.dlang.org/thread/ov20hp$1ip6$1@digitalmars.com https://forum.dlang.org/thread/ov20hp$1ip6$1@digitalmars.com It is also possible for D to be as fast as C++ in many domains: we have LDC based on LLVM for optimisation (parity with clang), but I think that one of the biggest things is the flexibility to have (and determine what is) an efficient architecture.
- klickverbot 9y ago> it'd be the same amount of effort without as-fast-as-possible. While the first part is perhaps somewhat subjective, the second is just wrong. D allows you to get to the same bare-metal, no-holds-barred level of performance that C++ does – I wonder where that misconception would come from. Note that this is not just an academic possibility, but there are real-world use(r)s of D in exactly that domain, for example the folks at Weka.IO for their distributed file system. Of course, their sub-millisecond latencies don't leave much room for careless use of the garbage collector. But being careful about memory allocations for that sort of application is just as sensible a thing to do in D as it is in C++.
- vram22 9y agoI've used D some, for small command-line utilities. It has some good features. For anyone who wants to get an idea of what D is like, there are example programs on the dlang.org site. Rosetta Code will be another good site for examples. Also, some of my D programs are online here (a few of the posts are not about D code per se, the others are): https://jugad2.blogspot.in/search/label/DLang https://jugad2.blogspot.in/search/label/DLang
- cryptonector 9y agoI don't understand why mangled symbol compression is needed. Sure, you need to demangle it for debugging and such, but... all you need is a lookup table, and then you can just hash them down. Yeah, then you need that extra metadata, but with mangled symbols you have it anyways. Hashing + lookup seems much less error prone.
- nicwilson 9y agoBecause the pathological case was IIRC exponential in length range.chain.opertion.length and idiomatically D's `n` in those chain length is very large, sometimes large enough to crash `nm`. The compiler based on LLVM does support hashing the trailing portion of the symbol. You also need symbol names for linking.
- klickverbot 9y agoThere are some advantages to having access to a human-readable representation for the symbol name, for example because not every piece of binary tooling out there necessarily also supports reading debug info for the target platform in question. However, another benefit of this is simply that even if you can hash a huge string down to a fixed length, you still need to construct your huge string in the first place during compilation. With D generally being quick to compile, by the time your symbol names were in the megabytes, all the string creation and manipulation could take up an appreciable fraction of the total compile time. (No kidding – I was quite surprised to see this show up on the profiles as well.)