comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Multiple dispatch in Julia
Date: Sun, 15 Nov 2020 17:28:16 +0100	[thread overview]
Message-ID: <rorkus$i3t$1@gioia.aioe.org> (raw)
In-Reply-To: rore66$n82$1@z-news.wcss.wroc.pl

On 15/11/2020 15:32, antispam@math.uni.wroc.pl wrote:
> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>> On 15/11/2020 13:43, antispam@math.uni.wroc.pl wrote:
>>> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>>>> On 13/11/2020 13:55, antispam@math.uni.wroc.pl wrote:
>>>>> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>>>>>> On 12/11/2020 22:22, antispam@math.uni.wroc.pl wrote:
>>>>>>> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>>>>>>>> On 12/11/2020 18:56, antispam@math.uni.wroc.pl wrote:
>>>>>>>>> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>>>>>>
>>>>>> Either you have static typing or not. But there is no disagreement. You
>>>>>> said you do not know how to implement multiple dispatch (while keeping
>>>>>> the language statically typed), I said same thing.
>>>>>
>>>>> I do not see why failure (error) during dispatch would
>>>>> conflict with static typing.
>>>>
>>>> Because it violates typing. A multiple dispatch method is declared as
>>>> acting on the whole Cartesian product of classes of arguments and/or the
>>>> result. Violating that is type error. In Ada you cannot declare such
>>>> methods ARM 3.9.2 (12).
>>>
>>> OK, Ada defines it own terminology, conflicting with terminology
>>> used outside Ada.  Since this discussion clearly goes beyond
>>> Ada features my assumption was that general terminology applies.
>>
>> No, it is not a terminology issue. When an operation is declared it is
>> on all possible values of the arguments, unless explicitly stated otherwise.
> 
> Well, in typical multiple dispatch laggage method (operation)
> declaration is split into several part.  First part just introduces
> name.

[...]

Right. You can proclaim it all untyped and so avoid type errors. No 
types, no type errors.

>> The problem is that this is not possible to do. There is no contract of
>> a multiply-dispatching operation in languages like Julia. Which is why
>> it is a type error or an undefined behavior.
> 
> I did not look at Julia rules.  But languages which I know give
> tight contract on multiple dispatch.

How is it tight if it does not guarantee execution of the operation?

>> If you contracted the multiple-dispatch operation Print to propagate
>> exception on *certain* combinations of arguments that would not be a
>> fault either. The problem is with [un]certainty.
> 
> There is no uncertainty: language rules and program text exactly
> specify which argument combinations propagate exception and
> which go to specific implementation.

That would not qualify even if it were true. It must be the 
specification of the module where the type declaration appears, nothing 
else. Contract /= implementation of.

But of course Julia does not check the whole source code for consistency 
of dispatching calls. It is just typical "use it at your own peril" stuff.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

      reply	other threads:[~2020-11-15 16:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12  7:12 Multiple dispatch in Julia Jerry
2020-11-12  7:48 ` Dmitry A. Kazakov
2020-11-12  8:55   ` Jerry
2020-11-12 10:27     ` Dmitry A. Kazakov
2020-11-12 17:56   ` antispam
2020-11-12 18:28     ` Dmitry A. Kazakov
2020-11-12 21:22       ` antispam
2020-11-13  7:49         ` Dmitry A. Kazakov
2020-11-13 12:55           ` antispam
2020-11-13 14:59             ` Dmitry A. Kazakov
2020-11-15 12:43               ` antispam
2020-11-15 13:37                 ` Dmitry A. Kazakov
2020-11-15 14:32                   ` antispam
2020-11-15 16:28                     ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox