LECTURER | Andrea Corradini <andrea.corradini@unipi.it> |
Timetable | Monday 11:00 - 13:00, Room Fib L1
Tuesday 11:00 - 13:00, Room Fib L1 Wednesday 16:00 - 18:00, Room Fib C |
Office hours | By appointment sending an email to <andrea.corradini@unipi.it>. |
Syllabus of the course | Syllabus |
Recordings of lessons of AY 2021/22 | The course is held in presence, and lessons are not recorded. The recordings of the AY 2021/22 are accessible from here |
The final grade is based on the evaluation of the programming assignments
that will be proposed along the course, and on a final oral exam.
The programming assignments have to be submitted at the very latest ten
working days before the oral exam. During the oral exam the lecturer may
ask questions about any topic presented during the course
as detailed in the
Syllabus
of the course.
Students who cannot attend the course for valid reasons (e.g. visa problems) can ask the lecturer (as soon as possible, not later than the end of the course) to bring the 2021/22 academic year program, for which they can find the recordings of the lessons on page https://pages.di.unipi.it/corradini/Didattica/AP-21/. |
Structure of the Oral ExamThe Oral Exam consists of three parts:
|
Exam datesStudents can take the oral exam during the exam sessions, fixing a date with the lecturer. Each student should first register for one of the dates published on the portal https://esami.unipi.it/esami2/, which is only possible after filling the evaluation questionnaire. Next the student should send an email to the lecturer with subject "[AP-24] Oral Exam", proposing some dates for the oral exam (not earlier than ten days after the date of the email) and proposing the topics for the first part of the oral exam, as explained above.Note: The date of the oral exam can be fixed independently of the date published in the portal, even before that date. In particular, upon request, in January 2025 an oral exam can take place also before 13-01-2025. |
Presentation of the course |
Slides:
AP-2024-01-CourseOverview.pdf
AP-2024-02-MotivationsIntro.pdf |
Students attending the course are asked to fill in this FORM, thanks! | ||
Syntax, Semantics and Pragmatics Programming languages and Abstract Machines Compilation and interpretation schemes |
Slides: AP-2024-03-Compilation-Interpretation.pdf |
Suggested readings: Chapter 1 of Programming Languages: Principles and Paradigms
by Maurizio Gabbrielli and Simone Martini Compiler explorer: http://www.godbolt.org |
||
The Java Virtual Machine: architecture and runtime data areas. | Slides: AP-2024-04-Intro2JVM.pdf,till page 32. |
Suggested readings: Chapter 7: Run-time Enviroments Section 7.1, 7.2 and 7.4.1-2 of "The Dragon Book" JVM Internals, by James D. Bloom http://blog.jamesdbloom.com/JVMInternals.html Chapters 1 and 2 of The Java Virtual Machine Specification, Java SE 17 Edition |
||
Disassembling class files The Java Virtual Machine: Initialization and Verification. The JVM Instruction Set: properties, format and addressing modes. |
Slides: AP-2024-04-Intro2JVM.pdf, all. AP-2024-05-JVM-InstructionSet.pdf, till page 10. |
Suggested readings: JVM Internals, by James D. Bloom http://blog.jamesdbloom.com/JVMInternals.html Chapters 1 and 2 of The Java Virtual Machine Specification, Java SE 17 Edition Reference documentation: The Java Language Specification, Java SE 17 Edition |
||
The JVM Instruction Set, end. Just In Time compilation in the HotSpot JVM |
Slides: AP-2024-05-JVM-InstructionSet.pdf, all. |
Suggested readings:
Section 2.11 and Chapter 3 of The Java Virtual Machine Specification, Java SE 17 Edition Java Code To Byte Code - Part One, by James D. Bloom, http://blog.jamesdbloom.com/JavaCodeToByteCode_PartOne.html How the JIT compiler boosts Java performance in OpenJDK, by Roland Westrelin, https://developers.redhat.com/articles/2021/06/23/how-jit-compiler-boosts-java-performance-openjdk |
||
Exercises: Inspecting Java bytecode and the JVM
You can send your solutions to the lecturer with an email with subject "[AP-24] Solutions to EX 1". Do not send JAR files. |
Proposed Exercises: Inspecting the JVMInstructions: exercises-1-2024.pdfOther files: WrongQueue.java |
For this lesson please be sure to have installed:
|
||
Software Components: an introduction | Slides: AP-2024-06-SoftwareComponentsIntro.pdf |
Suggested readings: Chapter 1 and Chapter 4 of [COMP], Component Software: Beyond Object-Oriented Programming. C. Szyperski, D. Gruntz, S. Murer, Addison-Wesley, 2002. | ||
Software Components: the Sun approach, JavaBeans |
Slides:
AP-2024-07.JavaBeans.pdf |
Suggested readings:
|
||
Reflection in Java Annotations in Java |
Slides: AP-2024-08-Reflection.pdf. |
Suggested readings: The Java Tutorial on Reflection API, excluding Arrays and Enumerated Types. The Java Tutorial on Annotations. |
||
Frameworks and Inversion of Control | Slides: AP-2024-09-IOC.pdf |
Suggested readings:
|
||
On Designing Software Frameworks | Slides: AP-2024-10-DesigningFrameworks.pdf |
Suggested readings: |
||
Exercises: Java Beans, Reflection and Annotations You can send your solutions to the lecturer with an email with subject "[AP-24] Solutions to EX 2". If you want to send a JAR file, change the suffix of the file for example to RAJ, otherwhise GMAIL will block it. |
Instructions: exercises_2.html |
For this lesson we suggest to use Apache NetBeans.
We will start with a quick look at the Oracle JavaBeans Tutorial |
||
Polymorphism:
|
Slides: AP-2024-11-Polymorphism.pdf AP-2024-12-Templates.pdf (up to page 15)
Compiler Explorer: https://godbolt.org/ |
Suggested readings:
|
||
Universal Parametric Polymorphism: C++ Templates and Java Generics
|
Slides:
AP-2024-12-Templates.pdf (C++ templates) all AP-2024-13-Generics.pdf (Java Generics) up to page 25.
Compiler Explorer: https://godbolt.org/ |
Suggested readings:
|
||
Wildcards in Java Limitations of Generics. The Standard Template Library for C++ |
Slides:
AP-2024-13-Generics.pdf (Java Generics), all. AP-2024-14-STL.pdf (STL).
|
Suggested readings:
|
||
Introduction to Functional Programming
|
Slides: AP-2024-15-FP.pdf (Functional Programming) |
Suggested readings:
|
||
More on Haskell...
|
Slides: AP-2024-16-Haskell2.pdf |
Suggested readings: | ||
Exercises on functional programming with Haskell You can send your solutions to the lecturer with an email with subject "[AP-24] Solutions to EX 3". |
Instructions: exercises_3.html
Online documentation of Haskell functions: |
Students are invited to install the Glasgow Haskell Compiler and Interpreter (GHCI) downloadable from https://www.haskell.org/downloads/ | ||
|
Slides: AP-2024-17-Lambda.pdf |
Suggested readings:
| ||
Type classes in Haskell
Type inference |
Slides: AP-2024-18-TypeClasses_inference.pdf, up to page 40. |
Suggested readings:
|
||
Type inference Constructor Classes and Monads in Haskell |
Slides: AP-2024-18-TypeClasses_inference.pdf, all. AP-2024-19-Monads.pdf, till page 17. |
Suggested readings:
|
||
The lesson of Monday, November 4 is canceled because of unavailability of the lecturer | ||||
More on Constructor Classes and Monads in Haskell Input-Output in Hakell: the IO Monad Type (un)safety in Haskell: unsafePerformIO |
Slides: AP-2024-19-Monads.pdf, all. |
Suggested readings: |
||
Exercises on Type Classes in Haskell
You can send your solutions to the lecturer with an email with subject "[AP-24] Solutions to EX 4". |
Instructions: exercises_4.html
Online documentation of Haskell functions: |
Students are invited to install the Glasgow Haskell Compiler and Interpreter (GHCI) downloadable
from https://www.haskell.org/downloads/
|
||
Lambda expressions in Java 8 | Slides: AP-2024-20-JLambdas.pdf |
Suggested readings:
|
||
The Stream API in Java 8 | Slides: AP-2024-21-JStreams.pdf. |
Suggested readings:
|
||
Exercises on Java Stream API You can send your solutions to the lecturer with an email with subject "[AP-24] Solutions to EX 5". |
Exercises on Java Stream API: exercises_5.html |
Students are invited to bring their laptops. Be sure
to have installed:
|
||
The Java Memory Model | Slides: AP-2024-22-JavaMemoryModel.pdf. |
The reading material for the JMM is:
[Manson05] Jeremy Manson, William Pugh, and Sarita V. Adve. The Java memory model. In POPL '05: 378-391 [see also here]
Additional material:
|
||
The RUST programming language: An introduction (Part 1) | Slides: AP-2024-23-RUST.pdf. |
Suggested readings from the Rust book:
|
||
The RUST programming language: An introduction (Part 2) | Slides: AP-2024-24-RUST.pdf |
Suggested readings from the Rust book:
|
||
The RUST programming language: An introduction (Part 3) | Slides: AP-2024-25-RUST.pdf. |
Suggested readings from the Rust book:
|
||
Programming assigments on JavaBeans and Reflection/Annotations in Java. |
First programming assignment
[Suggested deadline: December 20, 2024, flexible] |
|||
An introduction to Python | Slides: AP-2024-26-PythonIntro.pdf. |
Suggested readings:
|
||
Functional programming in Python | Slides: AP-2024-27-Python-Functions.pdf. |
Suggested readings:
|
||
Python: Object Oriented Programming, Encapsulation, Iterators and Generators. | Slides: AP-2024-28-Python-OOP.pdf, till page 23 |
Suggested readings:
|
||
Python: Typing and Polymorphism, Garbage Collection and Memory Safety, the GIL, Builtins and Libraries. |
Slides: AP-2024-28-Python-OOP.pdf, all. |
Suggested readings:
|
||
Exercises on Python You can send your solutions to the lecturer with an email with subject "[AP-24] Solutions to EX 6". |
Exercises Python: exercises_6.html Auxiliary file: anagram.txt |
Students are invited to bring their laptops. Be sure
to have installed the Python interpreter, downloadable from: This is the last lesson of the course |