My choice to pick Go over D ( and Rust ), mostly non-technical
Boris-Barboris
ismailsiege at gmail.com
Mon Feb 5 22:02:09 UTC 2018
On Monday, 5 February 2018 at 20:12:09 UTC, Walter Bright wrote:
> Most of those gcc builtin's I've never heard of, and I've been
> programming C for 35 years now. I've also never had a use for
> them. I find it hard to believe that list would be a deal
> breaker, especially since much of it seems to be a replacement
> for the inline assembler, and D has a nice inline assembler.
Inline assembler requires, ghm, assembly. Builtins are a bit more
gracious.
I have been dabbling in C for 6 months during OS course about 3
years ago, when I for some reason wanted to have a good
understanding of Linux scheduler, and I wrote a toy real-time
periodic scheduling class. The code there is swarming with stuff
like 'likely\unlikely' and other tricks, wich is understandable,
if the importance of it's speed is taken into consideration. The
point is, I could use stuff written by people way more
experienced than me without writing a single line of assembly,
just because it was already there, tested and integrated into the
compiler, and there were plenty of examples in other parts of
battle-tested code.
"Here is a one-liner wich may make your condition statements
faster, if you use it right. Here's how you use it, here's the
doc wich teaches how it works under the hood, so you don't cargo
cult". Pretty neat in my opinion. Of course you can write it in
asm, but you don't need to under gcc.
Oh, and look what I just found:
https://github.com/rust-lang/rust/issues/26179
> This is called "checklisting". One lists the features of X
> culled from the documentation, and then compares it with Y.
> Inevitably, Y is found wanting. The checklist is never taken
> from the features of Y, because then X would be wanting :-)
>
> This can be done with virtually any X and Y.
If Y is not a superset of X, you always lose something when
ditching X for Y. No place for miracles under the sun.
> (Also, the builtins are extensions, and are hardly reliably
> available in any random Standard-conforming C compiler.)
I am of the opinion that currently C has no use outside of
OS\embedded stuff (everywhere else it has a superior competitor,
imo), and therefore I don't share this concern about C's
portability. Well, that, and the fact that I am probably of about
half of your age, wich distinguishes the C we know. You probably
remember it big\general purpose, but it never was in my days.
Extentions wouldn't emerge, if pure C was enough.
More information about the Digitalmars-d
mailing list