Original title:
Typová inference a polymorfismus pro jazyk C
Translated title:
Type inference and polymorphism for C
Authors:
Klepl, Jiří ; Kratochvíl, Miroslav (advisor) ; Šefl, Vít (referee) Document type: Bachelor's theses
Year:
2020
Language:
cze Abstract:
[cze][eng] Jazyk C, i přes své stáří, stále patří mezi přední jazyky programování počítačových systémů. Jeho ceněnou přednosti je, že uživateli poskytuje takřka úplnou kontrolu nad správou paměti a nad prováděnými výpočty. C však snáší kritiku za to, že v něm chybí prvky umožňující generické programování, což se v C kompenzuje používáním preprocesorových maker, což zvyšuje náchylnost na uživatelské chyby. Tento problém již řeší jazyk C++ už od počátků svého vývoje, ale spousta vývojářů počítačových systémů jej odmítá pro jeho komplexitu a netranspar- entnost kódu. Předkládáme tedy návrh na jednodušší řešení užitím typového systému Hindley-Milner. Toto řešení pak jen za drobých úprav syntaxe jazyka C poskytne mnohem vyšší expresivitu jazyka. 1The C language, despite its age, is one of the main languages in systems development. It is valued for giving the user almost complete control over the memory management and the computations the program written in it performs. However, a large portion of criticism of C arises from the lack of generic programming features. C compensates that by utilizing preprocessor macros, which are prone to user errors. This problem has been addressed in the early stages of the development of the C++ language, but many systems developers refuse C++ because of its complexity and non-transparency of the code. We propose a simpler solution by applying the Hindley-Milner type sys- tem extended by Haskell type classes and type constructors. We will show that this approach is viable even with minimal changes to the syntax of C, but giving it much higher expressiveness. 1
Keywords:
compilers; programming languages; type systems; programovací jazyky; překladače; typové systémy
Institution: Charles University Faculties (theses)
(web)
Document availability information: Available in the Charles University Digital Repository. Original record: http://hdl.handle.net/20.500.11956/121006