RFC on range design for D2
bearophile
bearophileHUGS at lycos.com
Tue Sep 9 16:07:58 PDT 2008
Andrei Alexandrescu:
>you seem to expose a false dichotomy: "simple" versus "allows power"/"allows STL".
For all I know, much of Walter's claim to fame with D is that he proved that power/efficiency and ease of use are not an either-or choice as most people thought.<
I have given a hand developing a Python => C++ compiler, "ShedSkin", that contains a complex type inferencer. It compiles a large subset of Python code in quite efficient code. That project has shown me for the first time that it can exist a very clean language that's rather efficient too.
So I know that in theory it's often a false dichotomy, but in practice if you look at languages around, you generally have to pay for increased efficiency with uglier syntax, more complex language, more bug-prone language, etc.
>D is meant to be a systems-level programming language, and as such one clear goal of it is to obviate a need for C++.<
C and BitC too are system languages, but they don't try to be as C++. There are many projects today that use C instead of C++, for example Perl/Ruby/Python source code is in C, etc.
I like D to be a system language but I don't think it's wise for D to try to become a full replacement for C++. I think of D like a C/Java cross, with OOP, generic programming, more sugar and built-in safeties :-)
>In the inner circles of C++ there's often talk about how a replacement for C++ looks like, and to quote a classic who reflects the general opinion: "Whatever replaces C++ should be at least as good as C++ at whatever C++ is good at, and better than C++ at whatever C++ is bad at."<
That idea of yours scares me a little: I believe that if you want to create a language able to do *everything* better than C++ you may end creating a language almost like C++. I was hoping for D to become less powerful (and quite less complex) than C++. Many things in D1 are designed to be less powerful than C++ ones. So now I'd like to know what Walter thinks about this subject (and other people), because there's a large difference in what I think D wants to be and what you say to me.
This also shows that general discussions are sometimes as important as discussing details :-)
>And what would you rather have in the standard library? And what advantages are you showing in exchange for the steep penalty in efficiency?<
You are right. Note that my libs aren't meant as replacement for the std lib.
>(I looked over your library a while ago and it seems to use delegates everywhere.)<
Yes, the situation is the same, I have just refined things, added more things, etc. (Two other people have told me that they don't like this.)
>Again you offer a false dichotomy. Do I want a beautiful wife or a smart one? D code can enjoy the properties you mention without needing to pay an arm and a leg for them.<
More information about the Digitalmars-d-announce
mailing list