What languages did influence D notably
Abdulhaq
alynch4048 at gmail.com
Sat Sep 3 16:59:25 UTC 2022
On Saturday, 3 September 2022 at 16:19:26 UTC, tsbockman wrote:
> On Saturday, 3 September 2022 at 03:32:35 UTC, Jack wrote:
>> ALgo, Java, Python, Ruby, C# and Effiel. What are some other
>> languages?
>
> The top influences are of course C++ and C. Walter Bright
> intended D1 as an improvement over C++, whose quirks and faults
> he became very familiar with while working on his commercial
> C++ compiler.
>
> C is also explicitly a major influence, given that much of D's
> basic semantics and syntax were chosen with the goal that C
> code should be easily translatable into D by non-experts, with
> the obvious translation either having compatible semantics, or
> failing at compile time. D's ABI compatiblity through
> `extern(C)`, use of the C runtime library, and `-betterC` mode
> are further evidence that C is the dominant influence, along
> side C++.
I see it differently. There are more knowledgeable people here
for sure but my understanding is that Walter, having written a
C++ compiler (and BTW at some point a Java compiler) saw how C++
could be both simplified and also made more powerful (better
templating etc.). Now, C++ supported C as part of the C++
philosophy, presumably to help ease adoption of C++,
interoperating with the kernel (libc etc), and to leverage all
those pre-existing C libraries. Walter also stuck with the idea
to try to maintain compatibility with C, for much the same
reasons. Hence I say that D was primarily influenced by C++, and
only indirectly by C. Putting it into other words, if C++ had not
supported C, then D would also not have done so.
-betterC came relatively recently as a quick and easy win to get
converts from the C community (amongst other reasons). It doesn't
necessarily indicate that D was directly influenced by C or its
philosophy.
When I read TDPL I did gain a sense that Python had also somewhat
influenced the design, but maybe that was my imagination. I'm
thinking of imports and the 'turtles all the way down' philosophy.
More information about the Digitalmars-d
mailing list