Rant after trying Rust a bit

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 26 15:47:22 PDT 2015


On Sunday, 26 July 2015 at 15:33:59 UTC, Andrei Alexandrescu 
wrote:
> On 7/26/15 5:04 AM, deadalnix wrote:
>> On Sunday, 26 July 2015 at 00:18:14 UTC, Walter Bright wrote:
>>> On 7/25/2015 3:59 PM, deadalnix wrote:
>>>> On Saturday, 25 July 2015 at 12:05:12 UTC, Andrei 
>>>> Alexandrescu wrote:
>>>>> Well at least all paths must be compiled. You wouldn't ship
>>>>> templates that
>>>>> were never instantiated just as much as you wouldn't ship 
>>>>> any code
>>>>> without
>>>>> compiling it. We've had a few cases in Phobos a while ago of
>>>>> templates that
>>>>> were never instantiated, with simple compilation errors 
>>>>> when people
>>>>> tried to
>>>>> use them. -- Andrei
>>>>
>>>> That is an instance of happy case testing. You test that 
>>>> what you
>>>> expect to work
>>>> work. You can't test that everything that is not supposed to 
>>>> work do
>>>> not, or
>>>> that you don't rely on a specific behavior of the thing you 
>>>> are testing.
>>>>
>>>
>>> Um, testing all paths is not happy case testing.
>>
>> You test all execution path, not all "instantiation path". 
>> Consider
>> this, in a dynamically typed language, you can have a function 
>> that
>> accept a string and do something with it. You can write unit 
>> tests to
>> check it does the right thing with various strings and make 
>> sure it
>> execute all path.
>>
>> Yet, what happen when it is passed an int ? a float ? an array 
>> ? an
>> object ? Probably random shit.
>>
>> Same here, but at instantiation time.
>
> No, you are very wrong here. I am sorry! Instantiation testing 
> is making sure that syntactic conformance is there. Semantic 
> conformance cannot be tested during compilation (big 
> difference) and can be partially verified dynamically.
>
> This whole conflation with dynamic typing/unittesting is 
> inappropriate and smacks of 
> https://en.wikipedia.org/wiki/Argument_from_analogy. If you 
> have a point, make it stand on its own.
>
>
> Andrei

It is not an analogy. The dynamic typing is not a problem that is 
used as example or something. This is fundamentally the same 
problem. I've made that point earlier, and I stand by it.

Claiming it is inappropriate do not make it so. Once again, 
statements do not constitute good arguments. If you make a good 
point that they differs in such a way that I missed then you 
basically ends the argument.



More information about the Digitalmars-d mailing list