Q&A Monday, 11:30-12:20, 560
final exam Wednesday, 2:30, here
everything: lectures/sections/exercises/hws/readings
including today’s reading, minus Rust/JavaScript
what have we been doing for the last 10 weeks?
programming: C/C++
systems: talk to the OS for fs/net/proc/thread/…
tools: make, gcc, gdb, valgrind, nc, …
coding discipline
deal with uncertainty: debugging, learning, communication
curiosity
designed to write OSes (Unix)
abstractions: fixed-width integers, pointers, structs, …
control: compilers won’t generate code you didn’t write
“easy” to understand & tune performance
trade-off: easy to shoot oneself in the foot
tries to keep the good/low-level part
higher-level abstractions
encapsulation: class (members/methods), namespace
polymorphism: virtual functions & templates
(compare to function pointers & macros)
examples: std::string
vs char *
, std::thread
vs pthreads
performance vs safety: garbage collection, big integers?
choose language(s) that work best for your applications
real-world concerns: easy to hire? fit existing code bases?
keep an open mind: Rust, Go, Java, Racket, OCaml, Haskell, …
this course: programming interface to the kernel
memory management, file systems, networking, threading
general principles
naming: filenames, DNS, IP
file descriptors
virtual address: mmap, processes
virtual processor: processes/threads
example: valgrind
example: FILE *
, fd, kernel, disk
example: HTTP, TCP, IP, link layer
caching (fsync)
interface (zero-copying)
segfaults: much worse when bugs don’t segfault
valgrind: find memory leaks without it?
how to build tools & design tool-friendly systems/languages
example: Linux kernel
example: g vs ms
know what (not) to use
less error-prone constructs
performance trade-off
example: new
/delete
vs unique_ptr
programming is not everything
in: reading books/google/stackoverflow/manpages
out: giving talks & writing
341: programming langauges: principles & foundations
451: operating systems: lowest level of software stack
452: distributed systems: time, failure, coordination
grad courses: 505, 550, 551, 552
my humble advice
“perfect is the enemy of good”: end-to-end first; then improve
get your hands dirty (e.g., big-endian hands-on, learn Go in 452)
know yourself: what you like & you are good at
congratulations & good luck on the exam(s)!
big thanks to Sunjay, Renshu, Josue, Edward!
stay in touch: drop by 560, grab lunch, emails