4 ms·
A lot of people don't agree. But I feel category theory is the Maxwells Equation for software. What is the shortest distances between two points? A straight li
by deltasevennine 4y ago
A lot of people don't agree. But I feel category theory is the Maxwells Equation for software.
What is the shortest distances between two points? A straight line. I calculate the solution to that problem. I don't design it. What's the best way to travel between two points? Do I take a car or plane? Which is cheaper, faster, or more comfortable? I can't calculate a solution because the problem is to complex. Instead I design the solution to the problem. That is the fundamental difference between design and calculation.
Whenever you use the word "design" you are operating in a zone where humans have no foundational optimization theory. You are guessing, using your instincts, your common sense and your gut to find solutions for the problem. It's unlikely you'll hit the most optimal solution, but you can very likely arrive at a "good" solution.
If you squint, Category theory looks to fill this gap for designing programs. Depending on how you look at it, category theory looks like a fundamental theory on how to organize code. It can be thought of as a fundamental theory on abstraction or a fundamental theory on interfaces.
Maybe another way to put it is that the concept of interfaces are the maxwells equations of software..
Even turing machines/lambda caculus seem oddly specific let alone lisp. If we want something fundamental and general I think Category theory is it.
My guess is, if the advancement of computer science was allowed to play out for centuries and we got rid of all the historical baggage, some form of category theory would lie at the heart of it all.
- deterministic 4y agoLambda Calculus is a much better representation of computation than Category Theory. I can teach somebody functional programming using Lambda Calculus fairly quickly. It would take a lot longer using Category Theory. I have studied quite a bit of Category Theory but I would still struggle to explain beta-reduction using Category Theory. Another better system to use IMHO is Martin Luff style Type Theory. Much simpler. Much more useful in practice.
- deltasevennine 4y agoWell if teaching length justified the title of Maxwell's equations I would agree with you. CT does take longer to learn. However if foundational theory was what justified the title, I believe CT is more foundational then lambda calculus.
- martyalain 4y agoEvery time I try to understand what category theory is, I hit an impassable wall, I don't understand it. Alexander Grothendieck is much too intelligent for me. But I don't despair of getting there one day...
- deltasevennine 4y agoI'm not an math expert. I hated math. I learned it off of very informal material: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ https://bartoszmilewski.com/2014/10/28/category-theory-for-p... and his associated youtube videos (which are EVEN better): https://youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_ https://youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa...
- martyalain 4y agoThank you so much for these links, a lot to learn ...
- justinhj 4y agoEugenia Cheng has a couple of very accessible books on Category Theory
- austern 4y agoI was going to make the same recommendation. In particular I'd recommend her new book, _The Joy of Abstraction_. It's a real textbook that goes up through the Yoneda Lemma, but it isn't too scary and it doesn't assume that the reader already knows any theoretical math.
- deltasevennine 4y agoI read the first couple chapters. It's a bit too watered down in the beginning IMO. I couldn't get past the first part especially when she tries to relate category theory to feminism. Might come back to it later. As a non-math expert and programmer I highly highly recommend Bartosz stuff I linked it in another branch under my original comment.
- sicp-enjoyer 4y agoI do not agree with this (however, I only have one grad category theory course). I think category theory is a fine tool for formalizing computation and thinking about type systems, but wouldn't approach it as a program design tool.
- deltasevennine 4y agoAll of computation is related to types. You are taking Type A and converting it to Type B. That is the entire point of computation. All else is abstractions on top of that and algorithms below. Category theory is what lives on top. Haskell is a programming language and style that borrows very very heavily from category theory. Getting a certain level of mastery in haskell well help you see how programming is related to CT.
- sicp-enjoyer 4y agoI have studied haskell from this perspective. Like I said, you learn how to model computation and how the haskell language works, you don't learn how to design programs. I actually have gotten much more program design ideas from traditional branches of math (analysis, algebra, etc).
- deltasevennine 4y agoThen your comment doesn't make sense to me. If you designed programs in haskell then you designed them using concepts from category theory. Category theory isn't just about how haskell works. You use it to design your programs. Haskell is basically a category theory framework. I would say you didn't get very far then if you didn't come out of learning haskell with the realization of how you design programs with CT.
- hither_shores 4y ago> Haskell is basically a category theory framework. Haskell probably draws more from category theory than any other mainstream language, but in absolute terms that's still not very much. It's okayish for modelling cartesian closed categories, but if you want any more structure than that things get quite painful. Even something as simple as a category with finitely many objects requires stupid amounts of type-level boilerplate.