>  -------Original Message-------
>  From: Hisham Ahmed <[email protected]>
>  To: [email protected] <[email protected]>
>  Subject: [freedom] Purpose of using generics
>  Sent: 2023-06-16 01:42
>  
>  Dears,
>  
>  I'm planning to heavily use methods in generics and I saw many books about 
> it. 
> 

Abstraction is when you can see an underlying pattern across multiple specific 
implementation or applications.

This helps you pull out two things:

1. key concept
2. general pattern

Next we establish the properties so that the concept and the pattern are proven 
and any new observations can be made.

Formally, this is studied in modern mathematics and it's called 'Abstract 
Algebra'.

Alexander Stepanov, a Russian mathematician, pioneered the implementation of 
STL (Standard Template Library) for C++ in 1990's, which is one of it's kind.
http://www.stepanovpapers.com/stl.pdf

David Musser site is at
https://www.cs.rpi.edu/~musser/

Stepanov along with David Musser wrote a fascinating book, 'From Mathematics to 
Generic Programming'.
https://www.fm2gp.com/

This is a must read for anyone who wants to understand the subject properly.

Prof. Bjarne Stroustrup, in his OOPSLA 2006 paper titled "Linguistic support 
for Generic Programming in C++" described, "Generic algorithms are specified in 
terms of abstract properties of types, rather than in terms of particular 
types". This further refines the idea to 'Concepts'.
https://www.stroustrup.com/oopsla06.pdf

Other language designers have been inspired by the practical success of these 
ideas in C++ and enriched it with stuff like 'Type Erasure' and 'Type 
polymorphism'.
https://en.wikipedia.org/wiki/Type_erasure

Here is the insightful talk by Alexander Stepanov.
https://youtu.be/YlVUzJwN_Xc

Hope this helps all of us look at Type theory with renewed interest.


warm regards
Saifi.

Reply via email to