Cover of From Mathematics to Generic Programming

From Mathematics to Generic Programming

by Alexander A. Stepanov, Daniel E. Rose · first published 2015

31mentions
12recommended by
22HN commenters
2014–2025first – last mentioned

55% recommend41% neutral5% critical

Why HN recommends it

Approachable path from a basic algorithm like multiplication to abstract implementations, explaining the math along the way (abstract algebra, number theory). Gentler than Elements of Programming; suits C++ programmers.

Summarised by Claude from recommending comments

A detailed, mathematically-oriented examination of abstraction in software development leading to concepts and techniques in generic programming.

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

50 2007: 0 mentions2008: 0 mentions2009: 0 mentions2010: 0 mentions2011: 0 mentions2012: 0 mentions2013: 0 mentions2014: 1 mention2015: 3 mentions2016: 5 mentions2017: 1 mention2018: 2 mentions2019: 4 mentions2020: 1 mention2021: 2 mentions2022: 5 mentions2023: 1 mention2024: 1 mention2025: 1 mention2026: 0 mentions200720172026

What Hacker News says

  • RossBencina · Dec 28, 2016 · Recommends

    I have not yet read "Elements of Programming," but there is another book "From Mathematics to Generic Programming," also co-authored by Alexander Stepanov, which links Abstract Algebra to program design. I found the latter very approachable: https://smile.amazon.com/Mathematics-Generic-Programming-Ale...

    on “What Is Abstract Algebra? [video]” ↗
  • dilippkumar · Sep 26, 2021 · Recommends

    I’m currently enjoying “From Mathematics to Generic Programming” by Alexander Stepanov and Daniel E. Rose. One thing about the book is that it’s a lot more interesting than what a cursory scan of the table of contents would suggest. An O(log n) algorithm for multiplication…

    on “Ask HN: What is the best programming book you've read?” ↗
  • rickhanlonii · Jun 4, 2015 · Recommends

    …explains this really well by taking you from a basic algorithm to an abstract implementation, explaining the maths along the way (from multiplication to abstract algebra and number theory). It's titled From Mathematics to Generic Programming and I recommend it to anyone who wants to understand more of what I mean[2]. -- [1]: http://math.stackexchange.com/questions/165341/any-group-of-... [2]: http://www.amazon.com/Mathematics-Generic-Programming-Alexan...

    on “Ask HN: What are some important math topics every programmer should know?” ↗
  • Suncho · Apr 11, 2018 · Recommends

    …properly, you're well on your way to becoming a profiicent C++ programmer. His books are fantastic too. Elements of Programming: https://www.amazon.com/Elements-Programming-Alexander-Stepan... and From Mathematics to Generic Programming: https://www.amazon.com/Mathematics-Generic-Programming-Alexa... If you prefer video lectures, his second book is based off his lecture series Four (three) Algorithmic Journeys: https://www.youtube.com/playlist?list=PLHxtyCq_WDLV5N5zUCBCD...…

    on “Ask HN: What is the best Modern C++ MOOC?” ↗
  • mcguire · Aug 7, 2015 · Recommends

    That was kind of my impression, from the discussion in Alexander Stepanov and Daniel Rose's From Mathematics to Generic Programming (which is a pretty decent book, by the way). My understanding[1] is that concepts act like a type system for templates and like typeclasses in Haskell and traits in Rust. [1] http://maniagnosis.crsr.net/2015/07/abstracted-algebra-in-ru...

    on “C++ concepts support merged into GCC trunk” ↗
  • pjmlp · Jun 5, 2017 · Recommends

    …E. Leiserson, Ronald L. Rivest, Clifford Stein. "The Garbage Collection Handbook: The Art of Automatic Memory Management" from Richard Jones and Antony Hosking "Code Complete" from Steve McConnell "From Mathematics to Generic Programming" from Alexander Stepanov and Daniel Rose

    on “Ask HN: What language-agnostic programming books should I read?” ↗
  • earthicus · Aug 1, 2019 · Recommends

    Many of them feature prominently in Stepanov's books, Elements of Programming and From Mathematics to Generic Programming. 'Elements' is a technical monograph, while the other is a more lightweight read, halfway between semi-pop-science and a textbook. There's also an old textbook by Birkhoff & Bartee called 'Modern Applied…

    on “A Brief Guide to a Few Algebraic Structures” ↗
  • troupe · Jan 19, 2023 · Recommends

    From Mathematics to Generic Programming - Stepanov & Rose Gödel, Escher, Bach: an Eternal Golden Braid - Hofstadter Euclid's Elements

    on “Ask HN: Math books that made you significantly better at math?” ↗
  • troupe · Jan 19, 2024 · Recommends

    Two books that did for me what I think you are looking for: - From Mathematics to Generic Programming by Stepanov & Rose - Gödel, Escher, Bach: an Eternal Golden Braid by Hofstadter - The Little Schemer / The Seasoned Schemer

    on “Ask HN: Good books on philosophy of engineering?” ↗
  • rramadass · Jan 27, 2025 · Recommends

    …constrained genericity. This flexibility is quite powerful and you get full type checking. To understand all this (and apply the concepts in any other language) see the books by Alexander Stepanov viz. From Mathematics to Generic Programming and Elements of Programming.

    on “Liskov Substitution: The real meaning of inheritance” ↗
  • rramadass · Feb 15, 2025 · Recommends

    …with Abstract Algebra/Discrete Mathematics is assumed. The mapping he does from the mathematics to a language construct modeling a concept is what gives one the insight into programming. His other book From Mathematics to Generic Programming gives one a more "easier" approach to the subject and should be read in conjunction with this one for better understanding. A related old book is Ruminations on C++: A Decade of Programming Insight and…

    on “Elements of Programming (2009)” ↗
  • rramadass · Aug 14, 2022 · Recommends

    Related book by Stepanov and Rose : From Mathematics to Generic Programming.

    on “Quirky computing books” ↗
  • rramadass · Aug 1, 2025 · Recommends

    …https://en.wikipedia.org/wiki/Mathematical_proof 2) Computer-assisted Proof - https://en.wikipedia.org/wiki/Computer-assisted_proof In particular; see the "Philosophical Objections" section. 3) See also the book From Mathematics to Generic Programming by Alexander Stepanov and Daniel Rose to get an idea of how to map between mathematics and programming.

    on “Mathematics for Computer Science (2024)” ↗
  • pjmlp · Mar 7, 2018 · Recommends

    - Tour of C++ (http://www.stroustrup.com/Tour.html) - Principles and Practice Using C++ (http://www.stroustrup.com/programming.html) - From Mathematics to Generic Programming (http://www.fm2gp.com/) - The Scott Meyers books Some of the Bjarne Stroustrup videos, "Learning and Teaching Modern C++" - https://www.youtube.com/watch?v=fX2W3nNjJIo Some of the Herb Sutter videos,…

    on “Ask HN: Best way to learn modern C++?” ↗
  • sicp-enjoyer · Aug 14, 2022 · Recommends

    This is a great book. This wasn't mentioned in the past thread. Alex presents his ideas in my forms. This one happens to be the most terse and mathematical. That can be good, but I think "From Mathematics to Generic Programming" is much more generally approachable. One practical skill that's shown well in this book is writing functions that solve the easiest or special cases, and then layering those into general functions which…

    on “Elements of Programming (2019)” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help