Proceedings of the Institute for System Programming of the RAS
RUS  ENG    JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PACKAGE AMSBIB  
General information
Latest issue
Archive

Search papers
Search references

RSS
Latest issue
Current issues
Archive issues
What is RSS



Proceedings of ISP RAS:
Year:
Volume:
Issue:
Page:
Find






Personal entry:
Login:
Password:
Save password
Enter
Forgotten password?
Register


Proceedings of the Institute for System Programming of the RAS, 2015, Volume 27, Issue 3, Pages 29–46
DOI: https://doi.org/10.15514/ISPRAS-2015-27(3)-2
(Mi tisp134)
 

This article is cited in 1 scientific paper (total in 1 paper)

Pitfalls of C# generics and their solution using concepts

Julia Belyakova, Stanislav Mikhalkovich

Institute for Mathematics, Mechanics and Computer Science, Southern Federal University
Full-text PDF (301 kB) Citations (1)
References:
Abstract: As was shown in earlier studies, in comparison with Haskell type classes and C++ concepts such mainstream object-oriented languages as C# and Java provide much limited mechanisms of generic programming based on F-bounded polymorphism. Main pitfalls of C# generics are carefully considered in this paper. A special attention is given to drawbacks of recursive constraints (F-constraints), ambiguous semantics of interfaces, lack of language support for multi-type constraints and retroactive interface implementation, and subtle problems of the Concept design pattern, which is widely used not only in C#, but in Java and Scala as well. To solve the problems of C# generics, extending C# language with concepts is proposed: as a new language construct, concepts are to be used as constraints on type parameters exclusively, with object-oriented interfaces being used as types. In contrast to basic C++ concepts, C# concepts may include subtype and supertype constraints, allow constraints aliasing and automatic generation of default models. The major difference of the concepts design proposed is language support for multiple models. The latter feature is supported neither in C++ concepts, nor in Haskell type classes. In conclusion, a mechanism of implementation of concepts via translation to basic C# is outlined. The most important property of the translation is a possibility to recover a source code in extended language from a compiled module.
Keywords: generic programming, (C++) concepts, generics, C# language, concept pattern, recursive constraints, generic interfaces.
Bibliographic databases:
Document Type: Article
Language: English
Citation: Julia Belyakova, Stanislav Mikhalkovich, “Pitfalls of C# generics and their solution using concepts”, Proceedings of ISP RAS, 27:3 (2015), 29–46
Citation in format AMSBIB
\Bibitem{BelMik15}
\by Julia Belyakova, Stanislav Mikhalkovich
\paper Pitfalls of C\# generics and their solution using concepts
\jour Proceedings of ISP RAS
\yr 2015
\vol 27
\issue 3
\pages 29--46
\mathnet{http://mi.mathnet.ru/tisp134}
\crossref{https://doi.org/10.15514/ISPRAS-2015-27(3)-2}
\elib{https://elibrary.ru/item.asp?id=23832928}
Linking options:
  • https://www.mathnet.ru/eng/tisp134
  • https://www.mathnet.ru/eng/tisp/v27/i3/p29
  • This publication is cited in the following 1 articles:
    Citing articles in Google Scholar: Russian citations, English citations
    Related articles in Google Scholar: Russian articles, English articles
    Proceedings of the Institute for System Programming of the RAS
     
      Contact us:
     Terms of Use  Registration to the website  Logotypes © Steklov Mathematical Institute RAS, 2025