LECTURER
Tutor |
Andrea Corradini
<andrea.corradini@unipi.it>
Laura Bussi <laurabussi@live.it> |
Virtual classroom | To be used only in case of sanitary emergence. Advanced Programming Microsoft Team |
Timetable | Monday 11:00 - 13:00, Room M1
Tuesday 11:00 - 13:00, Room C1 Wednesday 9:00 - 11:00, Room C |
Office hours | By appointment sending an email to <andrea@di.unipi.it>. |
Recordings of lessons of AY 2021/22 | The recordings are accessible here. The topics of each lesson can be found in page AP-21 |
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. |
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-23] 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, also before that date. In particular, upon request, in January 2024 an oral exam can take place also before 17-01-2024, |
Presentation of the course |
Slides:
AP-2023-01-CourseOverview.pdf
AP-2023-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-2023-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-2023-04-Intro2JVM.pdf,till page 29. |
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 |
||
Disassembling class files The Java Virtual Machine: Initialization and Verification. The JVM Instruction Set: properties, format and addressing modes. |
Slides: AP-2023-04-Intro2JVM.pdf, all. AP-2023-05-JVM-InstructionSet.pdf, till page 19. |
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-2023-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 |
||
Software Components: an introduction | Slides: AP-2023-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. For the lesson of Wed. 4/10, please be sure to have installed:
|
||
Software Components: the Sun approach, JavaBeans |
Slides:
AP-2023-07.JavaBeans.pdf |
Suggested readings:
|
||
Exercises: Inspecting Java bytecode and the JVM
You can send your solutions to the lecturer with an email with subject "[AP-23] Solutions to EX 1". Do not send JAR files. |
Proposed Exercises: Inspecting the JVMInstructions: exercises-1-2023.pdfOther files: WrongQueue.java |
For this lesson please be sure to have installed:
|
||
Reflection in Java Annotations in Java |
Slides: AP-2023-08-Reflection.pdf. |
Suggested readings: The Java Tutorial on Reflection API, excluding Arrays and Enumerated Types. The Java Tutorial on Annotations. |
||
Polymorphism:
|
Slides: AP-2023-09-Polymorphism.pdf AP-2023-10-Templates.pdf (up to page 10)
Compiler Explorer: https://godbolt.org/ |
Suggested readings:
|
||
Exercises: Java Beans, Reflection and Annotations |
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 |
||
Universal Parametric Polymorphism: C++ Templates and Java Generics
|
Slides:
AP-2023-10-Templates.pdf (C++ templates) all AP-2023-11-Generics.pdf (Java Generics) up to page 16.
Compiler Explorer: https://godbolt.org/ |
Suggested readings: Java Generics tutorials:
|
||
Covariance of Arrays in Java Limitations of Generics. The Standard Template Library for C++ |
Slides:
AP-2023-11-Generics.pdf (Java Generics), all. AP-2023-12-STL.pdf (STL) up to page 12.
|
Suggested readings:
|
||
The Standard Template Library for C++ (cont.) Introduction to Functional Programming
|
Slides:
AP-2023-12-STL.pdf (STL), all AP-2023-13-FP.pdf (Functional Programming), up to page 7. |
Suggested readings:
|
||
Core concepts of Haskell | Slides: AP-2023-13-FP.pdf (Functional Programming), all. |
Suggested readings: see previous lesson |
||
More on Haskell
|
Slides: AP-2023-15-Haskell2.pdf |
Suggested readings: | ||
Exercises on fuctional programming with Haskell |
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/
Students are invited to complete the exercises at home and to send their solutions to the lecturer, as attachments to an email with subject "[AP-23] Exercise 3 - solutions". |
||
|
Slides: AP-2023-14-Lambda.pdf |
Suggested readings:
| ||
Type classes in Haskell |
Slides: AP-2023-16-TypeClasses_inference.pdf, up to page 33. |
Suggested readings:
|
||
Type inference Constructor Classes and Monads in Haskell |
Slides: AP-2023-16-TypeClasses_inference.pdf, all. AP-2023-17-Monads.pdf, till page 15. |
Suggested readings:
|
||
More on Constructor Classes and Monads in Haskell Input-Output in Hakell: the IO Monad Type (un)safety in Haskell: unsafePerformIO |
Slides: AP-2023-17-Monads.pdf, all. |
Suggested readings: |
||
Proposed exercises on Type Classes in Haskell |
Exercises on Type Classes in Haskell: 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/
Students are invited to complete the exercises at home and to send their solutions to the lecturer, as attachments to an email with subject "[AP-23] Exercise 4 - solutions". |
||
Lambda expressions in Java 8 | Slides: AP-2023-18-JLambdas.pdf |
Suggested readings:
|
||
The Stream API in Java 8 | Slides: AP-2023-19-JStreams.pdf. |
Suggested readings:
|
||
Proposed exercises on Java Stream API |
Exercises on Java Stream API: exercises_5.html Auxiliary file: people.csv |
Students are invited to complete the exercises at home and to send their solutions to the lecturer, as attachments to an email with subject "[AP-23] Exercise 5 - solutions". | ||
Programming assigments on JavaBeans, Reflection and Annotations in Java, and on Haskell. |
First programming assignment
[Suggested deadline: December 20, 2023, flexible] |
|||
Frameworks and Inversion of Control | Slides: AP-2023-20-IOC.pdf |
Suggested readings:
|
||
On Designing Software Frameworks | Slides: AP-2023-21-DesigningFrameworks.pdf |
Suggested readings: |
||
The Java Memory Model | Slides: AP-2023-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-2023-23-RUST.pdf. |
Suggested readings from the Rust book:
|
||
The RUST programming language: An introduction (Part 2) | Slides: AP-2023-24-RUST.pdf, till page 22. |
Suggested readings from the Rust book:
|
||
The RUST programming language: An introduction (Part 3) | Slides: AP-2023-25-RUST.pdf. |
Suggested readings from the Rust book:
|
||
An introduction to Python | Slides: AP-2023-26-PythonIntro.pdf. |
Suggested readings:
|
||
Functional programming in Python | Slides: AP-2023-27-Python-Functions.pdf. |
Suggested readings:
|
||
OOP in Python, Multi-threading and the GIL | Slides: AP-2023-28-Python-OOP.pdf. |
Suggested readings:
|
||
Second programming assignment |