comp.lang.ada
 help / color / mirror / Atom feed
From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: Using interfaces
Date: Sat, 2 Jun 2018 11:43:33 -0700 (PDT)
Date: 2018-06-02T11:43:33-07:00	[thread overview]
Message-ID: <9fa93d0f-30d2-4c79-b0ef-f94d96862da2@googlegroups.com> (raw)
In-Reply-To: <peujo0$ltb$1@dont-email.me>

On Saturday, June 2, 2018 at 12:22:09 PM UTC-5, Jeffrey R. Carter wrote:
> On 06/02/2018 05:20 PM, Gautier Niouzes wrote:
> > Hello,
> > I am developing a package for displaying some kinds of figures on an open set of devices. I'm trying to
> > use interfaces for that.

If you are yearning for multiple dispatch, then it could conceivably be achieved in modern Ada the way that single-dispatch OO was described for Ada83:

http://home.pipeline.com/~hbaker1/OOAdaLetters.html

Or you could hack multimethods into a forked GNAT.  The primary annoyance is how best to achieve a multidimensional look-up based on a coordinate of 2 or more tags, e.g., in O(1) time and O(mnᵏ) space(-per-executable/DLL) would be the multidimensional-array implementation (instead of today's single-dimensional tag-based array), where m is the quantity of tagged records, n is the quantity of densely-type-dispatched multimethods per tagged record, and k is the degree of mult- in multimethods/multiple-dispatch.  k=2 is called double dispatch.  k=3 is called triple dispatch. and so forth

A secondary annoyance is erroring out at compile-time if the program has any sparseness whatsoever in that multidimensional array (i.e., forgot to declare a multimethod for some combination of 'Classes).

> "IMHO, Interfaces are worthless."
> Randy Brukardt
> 
> He usually knows what he's talking about.

Ummmmm.  I suspect that Randy's statement neither started nor ended there.  Instead of being in ‘a pox on all their houses’ and ‘the horse they rode in on’ mode, I suspect that Randy in the very next sentence or paragraph said that language-construct X instead better accomplishes what ‘interface’-keyword constructs seek to do.

For example, in many modern programming languages, Ada included, there is a natural tension between the OO feature-set and the generic/parameterized-types feature-set as 2 nearly duplicated ways of accomplishing analogous goals.  Of course this is because runtime/tagged-record polymorphism and parametric/generic polymorphism are 2 forms of polymorphism at different vertexes on the lambda cube.

https://en.wikipedia.org/wiki/Lambda_cube

> "C++ is like giving an AK-47 to a monk, shooting him 
> full of crack and letting him loose in a mall and 
> expecting him to balance your checking account 
> 'when he has the time.'"

I would say that modern C++ is like giving the template engine Turing completeness with a syntax that is only slightly more readable than a Turing-machine's infinite-length tape and then making the entire reason for the language to exist to constantly put bandages on the never-quite-healing wounds inflicted by the Turing-completeness-in-the-template-engine bull goring the rest of the C++ language with its horns, as if the rest of the language is a porcelain shop that stocks only red items.  Oh wait.  No “like” about it; that is what really happened.


  reply	other threads:[~2018-06-02 18:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02 15:20 Using interfaces gautier_niouzes
2018-06-02 15:55 ` Jere
2018-06-02 17:00 ` Dmitry A. Kazakov
2018-06-02 17:22 ` Jeffrey R. Carter
2018-06-02 18:43   ` Dan'l Miller [this message]
2018-06-03  2:11     ` Shark8
2018-06-03  3:06       ` Dan'l Miller
2018-06-03  7:06       ` Dmitry A. Kazakov
2018-06-04  9:32 ` gautier_niouzes
replies disabled

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