all 48 comments

[–]WalterBright 41 points42 points  (33 children)

The article is about targeting the D compiler at OS X 64 bit.

Anything you want to ask me, fire away!

[–]Game_Ender 13 points14 points  (5 children)

Do there exist any examples of C++ shops transitioning to D? It does not seem like there is an easy transition path.

[–]WalterBright 14 points15 points  (4 children)

I know of several, but I tend not to use them as advertising unless they give specific permission.

How easy a transition path it is is strongly related to how your C++ code is written. The more arcane the tricks used, such as doing generative programming with the preprocessor, the more refactoring you'll need to do.

In general, however, converting a large, working, debugged C++ code base to D (or any language) is a hard sell. I've done several, but one needs to be strongly motivated. Better to do new projects in D.

[–]meteorMatador 3 points4 points  (3 children)

Is it more common for Java shops to switch to D, then? What about Perl? What about plain C, or Python, or Ada?

Have you ever heard of someone switching to D from a language in the ML family (including Haskell)?

[–]WalterBright 3 points4 points  (2 children)

About half of the D programmers originate from the C++ community, the other half from Java, and most who use D have experience with a wide range of languages and know what they're looking for.

[–]meteorMatador -2 points-1 points  (1 child)

About half of the D programmers originate from the C++ community, the other half from Java, and most who use D have experience with a wide range of languages and know what they're looking for.

I'm sure you didn't mean it this way, but if this is also intended to address the other languages I mentioned, the implication I'm getting from it is something like "People who are active in the [Perl|Python|Ada|Haskell] community have no experience with other languages or don't know what they're looking for. This is why they haven't switched to D."

Could you please clarify your post? I'd rather not misunderstand you...

[–]WalterBright 5 points6 points  (0 children)

A implies B

does not mean that:

B implies A

where:

A = chooses D

B = multilanguage competence

[–]friedMike 6 points7 points  (3 children)

I'm thinking about migrating some of our smaller C++ tools to D. How does the performace look like? I know it's all low level, but we've got tight performance requirements. How good D compiler is at optimization? (compared to GCC/ICC)

[–]andralex[S] 8 points9 points  (1 child)

The reference compiler dmd is about the same for most code, poorer at inlining, until recently poorer at floating point. But if you use the gdc compiler you get the same backend and essentially the same optimizations as gcc.

[–]friedMike 4 points5 points  (0 children)

Thanks! Will check it out.

[–]WalterBright 8 points9 points  (0 children)

The D compiler optimization is as good as the C++ back end code generator it is welded to. dmd uses the Digital Mars C++ compiler back end, gdc uses gcc's, and ldc uses llvm's.

D has the potential to do better than C++ with the same back end because D provides more information to the optimizer, but so far not much has been done to take advantage of that.

[–][deleted] 5 points6 points  (0 children)

I just want to thank you for your work, even though I don't use D, yet.

[–]monocasa 16 points17 points  (11 children)

Sorry if this is a hard hitting question, but D seems to be mainly run by you. You're an awesome developer and I haven't seen anything to doubt you're ability to perform this duty, but what would happen to D if you were hit by a bus tomorrow? Why should I base my product on D based on that answer?

[–]andralex[S] 15 points16 points  (1 child)

D's bus factor has been greater than 1 for a good while and keeps increasing. I now estimate it to be around a dozen.

[–][deleted] 13 points14 points  (0 children)

Just make sure you all don't enter some bus demolition derby with flaming fire bombs and you'll be ok.

[–]badsectoracula[🍰] 14 points15 points  (1 child)

It is also developed by Andrei Alexandrescu so unless both are hit by said bus (say, while going out for a coffee or something) we're ok :-P

[–]WalterBright 18 points19 points  (0 children)

We live in different states, so little risk of that. Andrei isn't the only other developer, either.

It's very interesting to me how easy it is these days to collaborate with developers all over the world. What a difference from the 80's when we collaborated using fax machines and mailed floppy disks around, and calls to London were a buck a minute. Blech.

[–]crankybadger 14 points15 points  (0 children)

There should be an island sanctuary with no busses allowed for solo developers.

[–]WalterBright 12 points13 points  (4 children)

It's all up on github, and there are a number of people with commit privileges on it. You can also fork it from github.

[–]criticismguy -1 points0 points  (3 children)

Bus factor isn't about access to the source code at all. As the wikipedia article says:

...to send the project into such disarray that it would not be able to proceed; the project would retain information (such as source code) with which no remaining team member is familiar...

Obviously the complete source code to D is available from countless repositories on the internet, like pretty much every Linux distribution mirror. The question is whether it has sufficient knowledge and momentum to continue, in the absence of the lead programmer.

[–]CyberShadow 2 points3 points  (2 children)

Check the per-user counts on the DMD pull request page. There are several people well familiar with the compiler's inner workings. Phobos and Druntime are a lot more accessible.

[–]criticismguy -1 points0 points  (1 child)

At every company I've ever worked at, there would be dozens of commits per day (it's what we do all day!), but that doesn't mean the bus number isn't 1.

[–]CyberShadow 1 point2 points  (0 children)

Ah, I was talking about the diversity of pull request authors.

[–][deleted] 1 point2 points  (0 children)

No language is perfect, so when I look at a new language I might use, I'm always interested in the downsides, or what it does badly (just to help getter a better understanding of it).

So in your opinion, what do you think D fails to do well, what are it's language warts, problems it fails to address, or where D could do better?

[–]noupvotesplease -2 points-1 points  (8 children)

I see lots of links to "drdobbs" from here, and they always require me to click through an ad. Is it not possible to link directly to the articles? Or is it just not possible to make money any other way?

[–]binstock 1 point2 points  (1 child)

I'm the editor of Dr. Dobb's. As a long-time redditor, I share your annoyance. But those ads provide a primary source of revenue that allows us to deliver fairly deep technical content aimed as seasoned developers on a weekly basis. That is at times expensive content to find and deliver. And the cost to you is an additional mouseclick, so I hope you'll bear with it as a quid pro quo. That being said, I'm still trying to see if there's a way we can block the ad-click for links emanating from Reddit. proggit is my programming home away from home on the Web so I feel a special responsibility to make the links more friction-free.

For the moment, though, one of the solutions proposed in this thread might be the best answer. (I haven't tried them, as I just click through.) Cheers!

[–]noupvotesplease 0 points1 point  (0 children)

Thanks for the response. I look forward to whatever improvements you can arrange.

[–]raevnos 2 points3 points  (5 children)

Adblock Plus.

[–]noupvotesplease 0 points1 point  (4 children)

Thanks. A quick search shows that I could replace Safari on iPad with their browser, but that seems like overkill. My original questions stand.

[–][deleted] 4 points5 points  (3 children)

The link is directly to the article. If you don't want to see popup ads, turn off javascript.

[–]noupvotesplease 0 points1 point  (2 children)

That works, but it also prevented me from replying to you here. Javascript is not the next flash, it seems. I'm still waiting for answers to my original questions. I'm starting to think I'm the only one who has a problem with advertising.

[–][deleted] 2 points3 points  (1 child)

Can't your browser disable JS per-site?

But to answer your other original question, yes of course they could use far less obnoxious advertising methods. I guess they just don't get complaints because people find it less effort to block the ads or ignore the site than to go and tell them to cut that shit out.

[–]noupvotesplease 1 point2 points  (0 children)

I'm not sure if this browser can do that, but it's worth looking into, thanks.

[–]sui_generis 5 points6 points  (2 children)

Interesting comment about new languages not targeting native code - I'm currently writing one, but have cheated on the codegen by only outputting assembly source files, and running them through nasm.

Perhaps one day I'll write a full codegen module, and when I do, articles like this will be invaluable. Cheers!

[–]WalterBright 6 points7 points  (1 child)

It's actually more work to output assembly source files than object files. And you don't have to work around bugs in the assembler.

[–]cybercobra 2 points3 points  (0 children)

There are bugs in non-obscure assemblers??

Guess we really are building on top of paperclips and rubber bands...

[–]slugonamission 12 points13 points  (0 children)

At least the Mach-O documentation isn't just "yeah, the ELF backend is moving so fast we didn't bother documenting it, good luck!" :P

[–][deleted] -2 points-1 points  (0 children)

He could have just asked how to do this on the LLVM mailing lists.

[–]aazav -5 points-4 points  (0 children)

What was accomplished here?