[phobos] Time to get ready for the next release

David Simcha dsimcha at gmail.com
Fri Apr 22 12:39:02 PDT 2011


On Fri, Apr 22, 2011 at 3:26 PM, Steve Schveighoffer <schveiguy at yahoo.com>wrote:

>  Like it or not, the same thing applies to things like:
>
> writeln = "hello";
>
> Even though we know this is not the right way to call it, the compiler
> doesn't give an error to enforce the semantics.
>
>
> -Steve
>

Ok, but just because you can do something utterly stupid like this doesn't
mean you should.  You can also do the following even though it's a terrible
idea, because it's impossible for the compiler to reject every terrible idea
without rejecting some good ideas:

import std.random;

// Overwrite random memory locations with random data until the program
// crashes
void main() {
    while(true) {
         auto num = uniform(0, int.max);
         auto ptr = cast(int*) num;
         *ptr = uniform(0, int.max);
    }
}

Again, I'd be more sympathetic to your point of view if making these changes
didn't also break existing code.  For me this is the tiebreaker.  I have
already designed a whole API around methods-as-properties.  I'm sure having
tons of code break will be very aggravating to a lot of people.  Given the
weak arguments put forth in favor of strict semantics, I can't bring myself
to say that breaking not only existing code but whole existing API designs
is justified.

BTW, as far as your argument about static typing, this may be a fundamental
disagreement between us.  I don't like static typing, but consider it a
necessary evil in exchange for performance and the ability to do low-level
work.  Therefore, I want only as much static typing as is necessary for
these to be possible.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20110422/6f34ca30/attachment.html>


More information about the phobos mailing list