Live data from Hacker News

Category Theory for Programmers (2014) [pdf]

github.com

21–30 of 136 posts

Re: Category Theory for Programmers (2014) [pdf]

#21

Earlier quoted context omitted.

Yeah. I couldn't have attempted learning about certain sorts of objects like Chu spaces, posets, or topoi without category theory. After having gone through the change and categorifying my thinking, I now find category-theoretic constructions everywhere in mathematics, and I find the mathematicians who refuse to examine category theory quite insufferable. Edit: More: The connection between type theory, logic, and com…

> I now find category-theoretic constructions everywhere in mathematics, i think gp might have been asking about practical use in CS ( CS majors).

And CS is merely a subfield of maths. What should I say? Scott theory, domain theory, CPOs, Galois connections? The problem here is that, as usual, folks are trying to figure out what category theory is good for, but ignoring the entire point: The definitions are the important part. Once the definitions make sense, then the rest of the system makes sense. Category theory is all about the definitions, and moreover, all about coming to have the definitions at hand so that one can recognize categorical structures in practice.

Or, I guess, I could take a lazy route and just say "theorems for free, those are the practical use" and be done. But it's frustrating to hear folks over and over wonder what something is good for, when they clearly aren't reading and trying to find the goodness for themselves.

Re: Category Theory for Programmers (2014) [pdf]

#22

I liked “An Invitation to Applied Category Theory“, pdf is available here: [1] It is written in a more terse, mathematical language, but it is very clear and friendly for non-mathematicians. The authors provide interesting examples of applicability. Hardcover is quite expensive, but the quality is great [2]. [1] http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf [2] https://www.amazon.com/gp/aw/d/1108482295

I've quite literally spent the last month trying to read, digest, and apply the above to a record layer I'm writing for FoundationDB. Dr. Spivak's work has been absolutely beyond helpful and insightful. There's no way I'd even be able to approach the subject with his efforts.

I'd also recommend these as they're associated with the 7 Sketches and help fill in some blanks:

Functorial Data Migration - https://arxiv.org/pdf/1009.1166.pdf

Category Theory as a Unifying Database Formalism - https://arxiv.org/pdf/1009.1166.pdf

Database Queries and Constraints via Lifting Problems - http://math.mit.edu/~dspivak/informatics/LiftingProblems.pdf

Additionally, there's also https://www.categoricaldata.net/ which helps provide more actualized implementation details of "FQL" (Functional Query Language) which he mentions in his papers.

For anyone else looking to get started with Category Theory, I'd also highly recommend choosing a functional library (i.e. something with Applicative, Functor, Category, Monad, Semigroup, Semgroupoid, Comonad, etc) in whatever language you're most familiar with and then _re-implement_ the functions to learn what it's doing (and what properties each class of item must conform to). In Elixir, I've been using Witchcraft... github.com/witchcrafters/witchcraft

For me, it has helped a great deal by forcing me to think about things like associativity, identity, and composition which I normally... didn't really do. It lends some nice patterns and naming conventions, even if you don't adhere to them perfectly. After a month of category theory, and only a crude/rudimentary understanding of it, has been enormously beneficial. My refactor of my FDB record layer after category theory has less code, works more correctly, and has more features. It's crazy...

Category theory gets 10/10 from me.

P.S. You'll probably, at some point, want to learn a little Haskell to help elucidate things in a "pure" context. It also helps as most every functional library is modeled after Haskell's standard library (? I'm still new, heh). To get started, this will save you time, as it seems most things in the Haskell world now-a-days be using this to setup/manage applications: https://docs.haskellstack.org/en/stable/README/

Re: Category Theory for Programmers (2014) [pdf]

#23
post #18

Question to all CS majors, that invested in learning Category Theory: Did you have any concrete take aways from learning it? ( I have a math background, and struggle to find something concrete. Maybe I am just blind. )

I believe my real analysis class made me a significantly better programmer and thinker in general, but I don't use anything specific from it (not yet, anyway).

What does real analysis have to do with category theory?

Re: Category Theory for Programmers (2014) [pdf]

#24
Watched that guy's lectures and conference talks. While it's quite interesting and educative - I still don't get the "for programmers" part of it. I don't quite get how I would jump from understanding categories, morphisms, monoids etc. to building actually better systems. There are zero practical examples in his talks. Is it because i'm not using functional languages or what am I missing here?

Re: Category Theory for Programmers (2014) [pdf]

#25

I liked “An Invitation to Applied Category Theory“, pdf is available here: [1] It is written in a more terse, mathematical language, but it is very clear and friendly for non-mathematicians. The authors provide interesting examples of applicability. Hardcover is quite expensive, but the quality is great [2]. [1] http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf [2] https://www.amazon.com/gp/aw/d/1108482295

If you're interested in going through "Seven Sketches", John Baez taught an online category theory course in 2018, with "Seven Sketches" as the text. Check out past lectures (and student discussion) here:

https://forum.azimuthproject.org/categories/applied-category...

Re: Category Theory for Programmers (2014) [pdf]

#26

I liked “An Invitation to Applied Category Theory“, pdf is available here: [1] It is written in a more terse, mathematical language, but it is very clear and friendly for non-mathematicians. The authors provide interesting examples of applicability. Hardcover is quite expensive, but the quality is great [2]. [1] http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf [2] https://www.amazon.com/gp/aw/d/1108482295

If you're interested in going through "Seven Sketches", John Baez taught an online category theory course in 2018, with "Seven Sketches" as the text. Check out past lectures (and student discussion) here: https://forum.azimuthproject.org/categories/applied-category...

This is awesome, holy crap, thank you so much.

For anyone else wanting some video, here's a link to youtube channel for some of the lectures: https://www.youtube.com/channel/UCUQlS-R4O094jP0sGHDnrjA

Re: Category Theory for Programmers (2014) [pdf]

#27

I liked “An Invitation to Applied Category Theory“, pdf is available here: [1] It is written in a more terse, mathematical language, but it is very clear and friendly for non-mathematicians. The authors provide interesting examples of applicability. Hardcover is quite expensive, but the quality is great [2]. [1] http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf [2] https://www.amazon.com/gp/aw/d/1108482295

This is probably one of the best introduction to category theory text out there now, but it isn’t exactly as friendly to the non-mathematicians as advertised. The book assumes a level of mathematical sophistication beyond what most non-math majors know and ramps up fast. The average programmer would probably get lost pretty quickly with this book.

Thanks for the feedback.

I’d like to elaborate on “friendly to non-mathematician”. The book is written for non-mathematicians with the focus on applications, and, like throwlaplace noticed in their comment, they put a lot of effort to explain the subject for the target auditory: diagrams, pictures, explanations, few proofs.

But, after all, it is a maths book on a highly abstract topic, therefore the reader should have some previous exposure to maths and mathematical texts, and expect to struggle, from the very first pages.

I think it is impossible to teach category theory to a person who does not have some basic knowledge in undergraduate maths, better in abstract algebra.

Re: Category Theory for Programmers (2014) [pdf]

#28

Earlier quoted context omitted.

This is probably one of the best introduction to category theory text out there now, but it isn’t exactly as friendly to the non-mathematicians as advertised. The book assumes a level of mathematical sophistication beyond what most non-math majors know and ramps up fast. The average programmer would probably get lost pretty quickly with this book.

Thanks for the feedback. I’d like to elaborate on “friendly to non-mathematician”. The book is written for non-mathematicians with the focus on applications, and, like throwlaplace noticed in their comment, they put a lot of effort to explain the subject for the target auditory: diagrams, pictures, explanations, few proofs. But, after all, it is a maths book on a highly abstract topic, therefore the reader should hav…

>The audience for this book is quite diverse: anyone who finds the above description intriguing. This could include a motivated high school student who hasn’t seen calculus yet but has loved reading a weird book on mathematical logic they found at the library. Or a machine-learning researcher who wants to understand what vector spaces, design theory, and dynamical systems could possibly have in common. Or a pure mathematician who wants to imagine what sorts of applications their work might have. Or a recently-retired programmer who’s always had an eerie feeling that category theory is what they’ve been looking for to tie it all together, but who’s found the usual books on the subject impenetrable.

Gives the idea this text should be accessible to those that haven’t seen calculus yet, presumably that would also mean those that haven’t had abstract algebra either. But in reality this book is more advanced than what the average retired programmer or average high schooler could understand on their own. It’s better suited for those that already are familiar with more advanced mathematics. I am not knocking the book. As mentioned, it is probably one of the best introductory books on Category theory currently out there.

Re: Category Theory for Programmers (2014) [pdf]

#29

Watched that guy's lectures and conference talks. While it's quite interesting and educative - I still don't get the "for programmers" part of it. I don't quite get how I would jump from understanding categories, morphisms, monoids etc. to building actually better systems. There are zero practical examples in his talks. Is it because i'm not using functional languages or what am I missing here?

Yeah, +100 I have this same problem in general. FWIW, the only real practical example I've seen (which has been rather serendipitous for me) is the "Seven Sketches in Compositionality" linked in the comments below applying category theory to databases. You can even play with the actual an implementation (written Java) to see some real world code here: https://github.com/CategoricalData/CQL Dunno if that helps your needs much but it was at least some kind of concrete starting point for me.

Re: Category Theory for Programmers (2014) [pdf]

#30

Earlier quoted context omitted.

Yeah. I couldn't have attempted learning about certain sorts of objects like Chu spaces, posets, or topoi without category theory. After having gone through the change and categorifying my thinking, I now find category-theoretic constructions everywhere in mathematics, and I find the mathematicians who refuse to examine category theory quite insufferable. Edit: More: The connection between type theory, logic, and com…

> I now find category-theoretic constructions everywhere in mathematics, i think gp might have been asking about practical use in CS ( CS majors).

Yeah exactly. I am interested in practical applications for programmers.

I know a thing or two about the prevalance of categories in Mathematics (https://arxiv.org/abs/1012.3121).

I heared many people talk about Haskell, Monads and Types Proof duality, but I never heard anyone saying: "I applied the Yoneda Lemma to build this API.", or "I read about Category Theory and now $CONCEPT_XYZ started making sense to me."

Post reply on HN