• A
  • A
  • A
  • ABC
  • ABC
  • ABC
  • А
  • А
  • А
  • А
  • А
Regular version of the site

Analysis of Different Compilation Strategies for Generics in Golang

Student: Tarasov Denis

Supervisor: Stanislav N. Fedotov

Faculty: Faculty of Computer Science

Educational Programme: Data Science (Master)

Year of Graduation: 2021

Generics is a short notation for a function or type that takes a type parameter. These features allow you to write code once, but then use it for several different specific types. Today, generics or similar entities exist in many programming languages. Their advantages are that they reduce the time to write code and its amount, and also simplify testing. There are currently no generics in the Golang programming language, although it is almost 12 years old. This was done intentionally, because the philosophy of this programming language is simplicity. But due to numerous requests from the developer community, the creators of the language decided to consider adding them. First, they developed an API, looking at several options and choosing the best one. Then they proposed its implementation in the form of a tool that translates code from Generic Go to Go 1 using code generation. In the future, it is planned to implement the ideas from this tool into the code of the language itself. The purpose of this work was to study other approaches to the implementation of the same functionality. After considering several options, we decided to use the reflect package. As a result, the created tool loses in terms of operating time and other parameters to the original tool, as expected.

Student Theses at HSE must be completed in accordance with the University Rules and regulations specified by each educational programme.

Summaries of all theses must be published and made freely available on the HSE website.

The full text of a thesis can be published in open access on the HSE website only if the authoring student (copyright holder) agrees, or, if the thesis was written by a team of students, if all the co-authors (copyright holders) agree. After a thesis is published on the HSE website, it obtains the status of an online publication.

Student theses are objects of copyright and their use is subject to limitations in accordance with the Russian Federation’s law on intellectual property.

In the event that a thesis is quoted or otherwise used, reference to the author’s name and the source of quotation is required.

Search all student theses