This final APL topic addresses programming for memory safety, and in particular the techniques used in the Rust language. Rust is a fairly recent language, designed for “safe systems programming”: providing low-level precise control for programmers, minimal execution overheads, and promises about correct use of memory and threads. In this short introductory lecture I covered the basics of Rust, and gave a few small indications of how its C-like appearance masks a quite substantial effort to do things differently.
Continue reading Lecture 15: The Rust Programming Language
This afternoon’s lecture presented ways to take proofs of code properties beyond correctness or safety of specific code into the domain of mobile applications, guarantees of trustworthiness, and complete systems.
Continue reading Lecture 14: Certifying Correctness
Today’s lecture presented two different facilities designed to help write Java code that does the right thing: the Java
assert statement; and JML, the Java Modeling Language. Continue reading Lecture 13: Practical Tools for Java Correctness
Today’s lecture was the first of three on language techniques and tools that aim to improve program correctness: not necessarily changing what a program does, the time or space it takes, or the power it uses; but making sure that what it does is the right thing to do. Of course, that also requires having some way to identify what that is to begin with.
Continue reading Lecture 12: Specification and Verification
This lecture concludes the set on concurrency with three distinctive challenges for concurrent programming and some possible solutions: lock networks, deadlock, and hand-over-hand locking; priority inversion in thread scheduling; and relaxed memory models for modern processor architectures. Continue reading Lecture 11: Cautionary Tales in Concurrency
Today’s lecture set out some alternative approaches for managing concurrency in programming languages: asynchronous message-passing Actors and the always-upbeat optimistic concurrency of Software Transactional Memory. These are two examples from a wide range of mechanisms in use across many programming languages and applications domains, all of which seek to balance the key concurrency requirements of separation to prevent inconsistency and co-operation to allow interaction.
Continue reading Lecture 10: Some Other Approaches to Concurrency
In this lecture I reviewed the built-in Java concurrency primitives, the challenges of writing thread-safe code, and introduced some patterns that can help: immutability, synchronization wrappers, and control abstractions like producer/consumer. More high-level currency abstractions, such as those in the
java.util.concurrent package, support programming that is not only thread-safe but takes explicit advantage of concurrency to increase performance and responsiveness. Finally, I walked through some intentionally racy code in the Java
Continue reading Lecture 9: Concurrency Abstractions
Today’s session was to review and give feedback in small groups on the preliminary reports submitted as the first stage of the APL assignment. Thanks to everyone who came along to today’s session and contributed their comments. This was the first time I’ve done this in the course, and I’m grateful to those who commented on the arrangements.
Continue reading Lecture 8: Peer Review and Feedback
Moving on from type systems, today’s lecture started a look at programming for concurrency: why you might want — or need — to write concurrent code and some of the challenges in doing so. I also introduced some of the concurrency primitives in Java and how they are used, as well as telling a story about the Apollo Guidance Computer and the robustness of its concurrent event handling under input overload.
Continue reading Lecture 7: Concurrency
Thanks to the very many students who sent in lists of online references for each of the five coursework topics. I have selected some of those I think most useful, and list them below. These links work today, Tuesday 11 October. If you find one broken while the assignment is still running, please email me and I’ll attempt to fix it.
Continue reading Coursework references