User: Password:
Subscribe / Log in / New account



Posted Mar 27, 2008 10:18 UTC (Thu) by khim (subscriber, #9252)
In reply to: an "old beard" ? by tialaramex
Parent article: Striking gold in binutils

<p><i>No-one, so far as I can see, is claiming that C++ actually made it significantly easier
to write this linker.</i></p>

<p>Huh? What is this, <a href="">then</a>? <i>The new
linker I am working on, gold, is written in C++. One of the attractions was to use template
specialization to do efficient byte swapping.</i> Of course it's not the only place where gold
is using C++ to speed things up, but look like you are complaining about C++ usage without
looking on code, without any research, "just in principle"... Not very constructive at

(Log in to post comments)


Posted Mar 27, 2008 11:46 UTC (Thu) by tialaramex (subscriber, #21167) [Link]

Actually that appears to be the author arguing that his program runs faster in part because it
avoids byte swapping on the native architecture, a trivial optimisation which he's managed to
manufacture into some C++ templates. In practice, looking at the sample code, templates seem
to deliver about the same maintainability as endian-swap macros, which is what an equivalent C
program (not the existing GNU ld) would use. I don't see a claim that it was actually /easier/
than macros, do you? Just that this optimisation is worth having, despite the complexity
compared to GNU ld.

Keep in mind I used to write my own programs in C++, and I stopped, so I'm not arguing from
ignorance or out of some misguided attempt to avoid learning something new. I made an explicit
choice to stop, and I think my choice was justified. At the time a lot of people told me it
was a mistake, but some of them have since stopped too.

But I don't want to waste my whole week arguing with language fanatics of any stripe. Code is
king, and anyway the main consumer for a faster linker is huge C++ programs, and this faster
linker is written in C++, so that should mean the people who care are already in a position to
look after it. Good luck, and if gold becomes the default please don't break the trivial cases
needed for linking my C programs.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds