<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 12 December 2013 22:21, Dicebot <span dir="ltr"><<a href="mailto:public@dicebot.lv" target="_blank">public@dicebot.lv</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thursday, 12 December 2013 at 11:42:12 UTC, Manu wrote:<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've built a C codebase from the ground over the course of a decade with<br>
~25 programmers.<br>
It takes discipline, and a certainly sense of simplicity in your solutions.<br>
</blockquote>
<br></div>
It may work if you can afford to guarantee certain level of competence of majority of programmers in the team but I think is exception in practice, not rule. Also I had a bit larger teams in mind as it tends to happen with enterprise C :)</blockquote>
<div><br></div><div>Completely true. Fortunately I've always worked on tech/engine teams, which are mostly populated with seniors, or competent up-and-comers.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and what is more valuable than a<br>
programmers time?<br>
</blockquote>
<br></div>
At some point new servers + server maintenance becomes more expensive than programmers time. Much more expensive.</blockquote><div><br></div><div>But that's not a concern for typical programmers. That the responsibility of sysadmins.</div>
<div>What I meant was, 'what's more valuable [to a programmer]...'</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I still consider C a macro assembler... I can easily (and usually do)<br>
visualise the asm output I expect the compiler to produce while I'm coding.<br>
If I'm writing performance intensive code, I am constantly disassembling<br>
and checking that the compiler is producing the code I am expecting. This<br>
feels normal to me.<br>
</blockquote>
<br></div>
Did you use many different compilers? I am afraid that doing that on a common basis is feat of strength beyond my imagination :)</blockquote><div><br></div><div>Yup. Over the past 10 years, my day job involved:</div><div>
VisualC (it's changed a LOT over the years), GCC (for many architectures), CodeWarrior (for many architectures), SNC (for many architectures), Clang, and some other proprietary compilers. You learn each of their quirks with time, and also how to reconcile the differences between them. You also learn every preprocessor trick imaginable...</div>
<div>Worse than the compilers is the standard libraries, which are anything but standard. In the end the ONLY function from the CRT that we called, was sprintf(). We had our own implementations of everything else we used.</div>
<div><br></div><div>I'm absolutely conscious of these sorts of issues when I consider my approach to D. Many of my vocal opinions stem from a desire to mitigate these sorts of problems in the future, and make sure it is possible to directly express codegen concepts that I've previously only been able to indirectly express in C compilers, which often requires some coercion for different compilers, and invariably leads to #ifdef.</div>
<div>It's important to be able to explicitly express low-level codegen concepts, even if these are rarely used features, it means it's possible to write code that is reliably portable. Sadly, most people really don't care too much about portability.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What would you want inline assembly for in D? Inline assembly is almost<br>
always a mistake, unless you're writing a driver.<br>
</blockquote>
<br></div>
I can't find code Adam used to provide minimal d runtime stubs to compile C-like programs but he was forced to use in-line assembly there in few cases. Can't remember details, sorry.<br></blockquote><div><br></div>
<div>Right. It's usually necessarily for hacks that have to interact with, or bend/subvert the ABI. But that's a pretty rare necessity, not a requirement in day-to-day code.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

And of course I am speaking about drivers / kernels / barebone. I can't imagine any other domain where using C is still absolutely necessary for practical reasons.<br></blockquote><div><br></div><div>You mean C-like-native-languages? There's not really anything C offers that C++/D doesn't also offer at the lowest level.</div>
<div>Our choice to use C rather than C++ was in a sense, a funny way to enforce a coding standard. Like I say, it forces simplicity, and a consistent approach to problems.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
You can't possibly<br>
schedule code better than the compiler.<br></div>
...<br>
</blockquote>
<br>
I am not implying that one should do anything by hand because compiler is bad at it. I have not actually used inline assembly with C even a single time in my life. That wasn't about it.<br>
</blockquote><div><br></div><div>The only thing I've ever had to use it for in recent years is manually fiddling with flags registers, or interacting with hardware-specific concepts that C/C++ doesn't have ways to express (interrupt levels, privilege control, MMU control, context switching). Also, SIMD. C++ compilers traditionally didn't have any vector support, so before intrinsics were common, you had to do all SIMD code in asm >_< .. Fortunately, that's a thing of the past.</div>
</div></div></div>