All Projects → lillo → compiler-course-unipi

lillo / compiler-course-unipi

Licence: other
Lab of the course Languages, Compilers and Interpreters (Cod. 653AA) @ UNIPI

Programming Languages

ocaml
1615 projects
Monkey C
6 projects
M4
1887 projects
LLVM
166 projects
Makefile
30231 projects
Standard ML
205 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to compiler-course-unipi

tiny-lang
tiny-lang — A different programming language. Supports a bunch of spoken languages.
Stars: ✭ 26 (+44.44%)
Mutual labels:  compilers, interpreters, compiler-design
pyCompiler
Python Compiler
Stars: ✭ 13 (-27.78%)
Mutual labels:  compilers, compiler-design
lua-in-rust
The Lua programming language, implemented in Rust.
Stars: ✭ 76 (+322.22%)
Mutual labels:  compilers, interpreters
AwesomeCompiler
The Big list of the github, open-source compilers.
Stars: ✭ 27 (+50%)
Mutual labels:  compilers, compiler-design
jet
A Fast C and Python like Programming Language that puts the Developer first. WIP
Stars: ✭ 41 (+127.78%)
Mutual labels:  compilers, compiler-design
kolasu
Kotlin Language Support – AST Library
Stars: ✭ 45 (+150%)
Mutual labels:  compilers, interpreters
librxvm
non-backtracking NFA-based regular expression library, for C and Python
Stars: ✭ 57 (+216.67%)
Mutual labels:  compilers, compiler-design
types-and-programming-languages
C++ Implementations of programming languages and type systems studied in "Types and Programming Languages" by Benjamin C. Pierce..
Stars: ✭ 32 (+77.78%)
Mutual labels:  compilers, interpreters
devtools-course-theory
Course on Development Tools (in Russian)
Stars: ✭ 18 (+0%)
Mutual labels:  course-materials
CSSS508
CSSS508: Introduction to R for Social Scientists
Stars: ✭ 28 (+55.56%)
Mutual labels:  course-materials
RL course
The page of the Ural Federal University course "Reinforcement Learning and Neural Networks"
Stars: ✭ 23 (+27.78%)
Mutual labels:  course-materials
compiler-design-lab
These are my programs for compiler design lab work in my sixth semester
Stars: ✭ 47 (+161.11%)
Mutual labels:  compiler-design
UniversalQCompiler
Synthesizing arbitrary quantum computations
Stars: ✭ 53 (+194.44%)
Mutual labels:  compilers
ooprogramming
Intermediate course introducing Object Oriented Programming (OOP) principles applied to the Java language. Recommend to learners with previous experience.
Stars: ✭ 50 (+177.78%)
Mutual labels:  course-materials
nearley-playground
⛹ Write Grammars for the Nearley Parser!
Stars: ✭ 76 (+322.22%)
Mutual labels:  language-design
DSMO.course
Data Science and Matrix Optimization course
Stars: ✭ 64 (+255.56%)
Mutual labels:  course-materials
programming-language-theory
Programming Language Research, Applied PLT & Compilers
Stars: ✭ 53 (+194.44%)
Mutual labels:  compiler-design
human-memory
Course materials for Dartmouth course: Human Memory (PSYC 51.09)
Stars: ✭ 239 (+1227.78%)
Mutual labels:  course-materials
PyTherm-applied-thermodynamics
Educational ipython source code for applied thermodynamics.
Stars: ✭ 62 (+244.44%)
Mutual labels:  course-materials
DRL in CV
A course on Deep Reinforcement Learning in Computer Vision. Visit Website:
Stars: ✭ 59 (+227.78%)
Mutual labels:  course-materials

Languages, Compilers and Interpreters (Lab) - 3 CFU

Teacher: Letterio Galletta

Contact: name.surname(at)imtlucca.it

Office hours: contact me by e-mail

Page of theory part of the course held by Prof. Roberta Gori: http://pages.di.unipi.it/gori/Linguaggi-Compilatori2022/

Course description

The course will present tools and techniques used in the implementation of programming languages. During the lectures students will work on programming assignments covering different aspects of language implementation. The programming language adopted for the exercises and the project is OCaml. At the end of the course students who completed all the assignments and the project will have developed an simple interpreter and a compiler.

Learning objectives

After completing the course, students will have

  • Known the basics of the functional programming language OCaml;
  • Implemented parsers using state-of-the-art parsers generators;
  • Designed and implemented semantic analyses for a functional and an imperative languages;
  • Used the LLVM toolchain for generating and optimize code;
  • Had some fun along the way! 😄

Program of the course

  • Introduction to functional programming and to OCaml language;
  • Lexing and parsing using ocamllex and menhir;
  • Semantic analysis implementation: type checking, scope management, control-flow analysis;
  • Introduction to LLVM infrastructure and LLVM intermediate language;
  • Code generation.

Lectures

This table specifies the lecture schedule with topics and materials.

See these instructions to set up your programming environment.

Date Topics Slides Examples Assignments
10/03 Intro to OCaml Intro to the lab
OCaml Tutorial
OCaml Tools
ocaml-basics.ml
OCaml Programming Problems
Exercises 1
10/10 - Intro to OCaml: records, algebraic data types
module, imperative features
- The interpreter of FUN
OCaml Tutorial
The interpreter of FUN
ocaml-basics.ml
vector.mli
vector.ml
fun.ml
Exercises 2
Exercises 3
10/17 Introduction to lexing with ocamllex Lexing with ocamllex cwd.mll
count.mll
count_fun.mll
stokens.mll
stokens_pos.mll
comments.mll
csv_simple.mll
toy_lang.mll
Exercises 4
10/24 - Parsing with menhir
- Presentation of MicroC project
Syntactic analysis with menhir
Introduction to MicrocC
calc
calc-alias
calc-ast
calc-ast-pos
calc-two
calc-multi
calc-incremental
json
FUN parser solutions of exercises 4.5 & 5.4
IoT-Lysa parser as an example of parser using FParsec
MinCaml parser as an example of parser using ocamlyacc
FrontC as an example of a menhir parser for a real language
Solidity-parser for an example of a menhir parser for a real language
Exercise 5
MicroC parser
10/31 No Lecture - - -
11/07 - Type analysis Type analysis FUN type checker
MinCaml
Incremental MinCaml
CADL
Grow Your Own Type System
The PL Zoo
Exercises 6
11/14 -Discussion on previous assignments
- Control-flow analysis
CFA analysis FUN CFA analysis
A toy static analysis tool based on the monotone dataflow analysis framework
VSA a framework for Value-Set Analysis
EthCA Ethereum Concurrency Analyzer
Exercises 7
11/21 - Control-flow analysis
- MicroC Semantic analysis
CFA analysis
MicroC Semantic analysis
- MicroC semantic analysis
12/02 Introduction to LLVM LLVM Infrastructure empty-module.ll
add.c
add.ll
main.c
fun-decl.ll
global-local.ll
local-vars.ll
arithmetic.ll
conditional.ll
phi-instruction.ll
call.ll
array-struct.ll
gep.c
gep.ll
deps.ll
Exercises 8
... ... ... ...

Final project

The final project of the course consists in implementing a compiler for MicroC. See here for the instructions.

Material

Software

Programming assignments will use the following pieces of software:

  • OCaml - try to install the latest version. All the code shown during the course is tested with the version 4.14.0.
  • Opam - OCaml package manager.
  • Menhir - a LR(1) parser generator for the OCaml programming language.
  • Clang - a compiler for C programs.
  • LLVM - The LLVM compiler infrastructure. All the code shown during the course is tested with the version 14.0.
  • rlwrap - a small utility to improve the editing capability of the OCaml REPL.
  • utop - an improved toplevel (i.e., Read-Eval-Print Loop) for OCaml.

Online Resources

Further resources

Here you find a list of further references that complete and deepen the various topics covered during the course. A rich collection of articles related to the course can be found in Prof. Matt Might's blog.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].