Details

Implementacije vezanih spremenljivk v programskih jezikih : delo diplomskega seminarja
ID Zupan Škrlj, Lovro (Author), ID Pretnar, Matija (Mentor) More about this mentor... This link opens in a new window

.pdfPDF - Presentation file, Download (374,64 KB)
MD5: CD94BECAF3EA3FCAB385D3AA33E4193B

Abstract
Pri implementaciji programskih jezikov programe pogosto predstavljamo z abstraktnimi sintaksnimi drevesi. Pri tej strukturi moramo biti posebej pozorni na predstavitev vezanih spremenljivk. Postopka preimenovanja spremenljivk in substitucije sta nagnjena k napakam. Naivne implementacije so pogosto neučinkovite. V delu je problem vezanih spremenljivk obravnavan na lambda računu, ki je preprost programski jezik funkcij. Predstavljeni so trije standardni pristopi k implementaciji vezanih spremenljivk: naivni pristop, de Bruijnovi indeksi in abstraktna sintaksa višjega reda. Predstavljena je tudi knjižnica Bindlib za OCaml, ki omogoča preprosto, varno in učinkovito delo z vezanimi spremenljivkami. Na koncu je opisana predstavitev vezanih spremenljivk programskega jezika Millet, ki služi kot osnova za razvoj prototipnih programskih jezikov. Implementacija vezanih spremenljivk v Milletu je izvedena z uporabo knjižnice Bindlib. Razlike v učinkovitosti predstavitev vezanih spremenljivk so prikazane z eksperimentom, v katerem merimo čas izvajanja štirih pristopov.

Language:Slovenian
Keywords:programski jeziki, vezane spremenljivke, OCaml
Work type:Final seminar paper
Typology:2.11 - Undergraduate Thesis
Organization:FMF - Faculty of Mathematics and Physics
Year:2026
PID:20.500.12556/RUL-186768 This link opens in a new window
UDC:004.43
COBISS.SI-ID:290144003 This link opens in a new window
Publication date in RUL:05.09.2026
Views:86
Downloads:16
Metadata:XML DC-XML DC-RDF
:
Copy citation
Share:Bookmark and Share

Secondary language

Language:English
Title:Implementations of bound variables in programming languages
Abstract:
When implementing programming languages, we usually represent computer programs as abstract syntax trees. With this representation we need to be especially careful when representing bound variables, because the implementations of variable renaming and substitution are error-prone. Naive implementations can result in poor performance. In this work, this problem is explored using the lambda calculus, which is a simple programming language of functions. Three representations of bound variables are presented: the naive approach, de Bruijn indices, and higher-order abstract syntax. The OCaml library Bindlib is also presented, as it makes working with bound variables simple, safe and efficient. Finally, the use of the Bindlib library is demonstrated with the example of the Millet programming language, which is used as a base when prototyping programming languages. The differences in the efficiency of bound variable representations are demonstrated by an experiment in which we measure the execution time of four implementations of the lambda calculus.

Keywords:programming languages, bound variables, OCaml

Similar documents

Similar works from RUL:
Similar works from other Slovenian collections:

Back