
Types and Programming Languages
by Benjamin C. Pierce · first published 2002
58% recommend38% neutral3% critical
Why HN recommends it
Clearly written, mathematically rigorous but well motivated introduction to type theory, lambda calculus and language semantics, with short focused chapters. Suits programmers who want a formal grounding in type systems.
Summarised by Claude from recommending comments
A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of type systems--and of programming languages from a type-theoretic perspective -- -has important applications in software engineering, language design, high-performance compilers, and security. This text provides a comprehensive introduction both to type systems in computer science and to the basic theory of programming languages. The approach is pragmatic and operational; each new concept is motivated
Affiliate links. As an Amazon Associate I earn from qualifying purchases.






…fascinating journey. Enjoy. EDIT: If you want to go deep into type systems (say you want to grok Haskell's type system from first principles, (or add OCAML like modules to your language, say) Benjamin Pierce's Types and Programming Languages - You are in good shape to work through this after you've finished EOPL
on “Create Your Own Programming Language (Book)” ↗In functional programming: [0] The Structure and Interpretation of Computer Programs [1] The_Little_Schemer [2] Programming in Haskell - Graham Hutton [3] Types and Programming Languages-Benjamin C. Pierce --- PDFS [0](https://github.com/allenleein/brains/blob/master/Zen-of-Func...) [1](https://github.com/allenleein/brains/blob/master/Zen-of-Func...) [2](https://github.com/allenleein/brains/blob/master/Zen-of-Func...)…
on “Ask HN: What are the best textbooks in your field of expertise?” ↗Types and programming languages, Benjamin Pierce: https://www.cis.upenn.edu/~bcpierce/tapl/ Its contents is what I consider the meta game of programming. Understanding types seems to be a real boost to think about architecture, implementation,…
on “Ask HN: Which books do you consider real gems in your field of work/study?” ↗…freely available online, so that's nice. (chapter 10 is on types) I haven't looked at the second edition at all yet, but the chapter on types looks like it has more code than math. Benjamin Pierce's Types and Programming Languages seems to be the gold standard of intro type theory, and definitely covers this notation and the math behind it, in a much more rigorous fashion than PLAI. It is a much deeper book though, so it doesn't…
on ““What part of Milner-Hindley do you not understand?”” ↗…Cardelli's "Typeful Programming"[1] to get an overview of what typed programming is all about, and see for yourself how brain-dead C and C++ are in comparison. After that go to Benjamin Pierce's canon, "Types and Programming Languages". [1]http://www.daimi.au.dk/~madst/tool/papers/typeful.pdf
on “Announcing TypeScript 0.9.1” ↗…that have been pilfered from CT via Wadler have only a passing resemblance/relation to their CT friends. Some things that I instead would recommend reading up on are: - Type theory (Benjamin Pierce's "Types and Programming Languages" is the de facto introduction to this. It covers everything from untyped lambda calculus to things way more complex than standard Haskell, including example implementations of type checker, etc.) -…
on “A Brief Guide to a Few Algebraic Structures” ↗Pierce's Types and Programming Languages is a phenomenal textbook. I'm almost done with my implementation of System F-omega (polymorphic lambda calculus with higher kinded types and type operators), featuring a full handwritten lexer/parser…
on “Developing a Statically Typed Programming Language (2017)” ↗"Types and Programming Languages" (aka "tapl")
on “Ask HN: What language-agnostic programming books should I read?” ↗Try a textbook? e.g. Types and Programming Languages by Benjamin C. Pierce.
on “Ask HN: How to be fluent in functional language speak?” ↗…make time for Structure and Interpretation of Computer Programs (http://mitpress.mit.edu/sicp/). Other good theory books: Concepts, Techniques, and Models of Computer Programming by Peter van Roy, and Types and Programming Languages by Benjamin Pierce. As for math - it's good to know some set theory and mathematical logic, but I wasn't a math major so I don't have good recs in that area.
on “Ask HN: How should I go about learning CS?” ↗…a whole bunch of different approaches to exploring that design space and implementing stuff in it. I also enjoyed reading Pierce's Types and Programming Languages (http://www.cis.upenn.edu/~bcpierce/tapl/), although I was kind of nodding my head and going "yeah, whatever" during some of the proofs.
on “Ask HN: After SICP, what next?” ↗…(A common error.) "What To Know Before Debating Type Systems" (http://www.pphsg.org/cdsmith/types.html) is a pretty good introduction to types. Also, while I'm only partway through Benjamin Pierce's _Types and Programming Languages_, it's been quite good so far.
on “Advanced programming languages” ↗From a PL perspective, you can't beat Benjamin Pierce's Types and Programming Languages. http://www.cis.upenn.edu/~bcpierce/tapl/
on “Stephan Wolfram: 100 Years Since Principia Mathematica” ↗…recommend leveling up on PL design. Self-modifying assembly code, in the bad old days, was not uncommon (as a performance optimization). It is, however, utterly unmaintainable. I would recommend the book Types and Programming Languages. Also, you should spend a year in a strongly and statically typed language. Start with Ocaml or Haskell because they are "purer", then move to Scala if you want. This will give you some ideas on what…
on “The State of the Art is Terrible” ↗Don Quixote. Touches on a lot: perception, value, narrative, ethics, creativity. Above all it is funny as hell and beautifully written. Types and Programming Languages, Benjamin Pierce, slightly intimidating mathematically for me but worth diving in, lots of interesting ideas, I'm only through to the second chapter.
on “Ask HN: Which book are you reading these days?” ↗