Re: Generic interfaces Daphne Preston-Kendal 23 Jul 2021 17:49 UTC

On 23 Jul 2021, at 14:18, Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:

> If I have understood John correctly, SRFI 225 is moving away from a registry towards an API that uses explicit type descriptors. Your view of SRFI 225 seems to be still based on the first draft.

Indeed, I had read through that thread on the SRFI 225 mailing list but had not realized the process of switching to your proposal was already underway. I will post some comments there shortly.

> Of course, such a type descriptor approach can also be extended to various other kinds (e.g. finite mappings aka dictionaries, sequences, algebraic structures).
>
> If this approach is used, Scheme will actually gain several advantages over the Python model: (1) An efficient AOT compilation can be possible while the highly dynamic Python model is slow. (2) Multi-parameter generic methods can be easily supported by taking more than one type descriptor. (3) In particular, generic methods that are not based on an existing object become possible.

The issue, though, is that ‘fast’ type descriptors (like Common Lisp’s TYPE-OF) are not portable.

Daphne