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
All posts by Ian Stark
Lecture 14: Certifying Correctness
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
Lecture 13: Practical Tools for Java 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
Lecture 12: Specification and Verification
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.
Lecture 11: Cautionary Tales in Concurrency
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
Lecture 10: Some Other Approaches to 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
Lecture 9: Concurrency Abstractions
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 String
library.
Continue reading Lecture 9: Concurrency Abstractions
Lecture 8: Peer Review and Feedback
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
Lecture 7: Concurrency
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
Coursework references
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