TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why I am learning category theory

209 点作者 larve超过 2 年前

28 条评论

Tainnor超过 2 年前
As someone with a maths degree, yet who admittedly hasn&#x27;t looked into category theory beyond some basic notions, I still don&#x27;t quite understand why anyone would want to learn category theory before e.g. abstract algebra or even just fundamental mathematical reasoning (definition, theorem, proof).<p>Maybe I&#x27;m missing something but it seems to me that all you can study monads <i>in programming languages</i> without having to also learn the category theory abstraction of it. The same goes for semigroups, monoids, folds, functors, ...<p>I&#x27;m sure there&#x27;s a benefit in category theory once you want to unify all these abstractions and talk about all of them together, but I see so many people who think they have to learn CT before they can understand monads in e.g. Haskell, and I don&#x27;t really understand why.
评论 #33806744 未加载
评论 #33804203 未加载
评论 #33804072 未加载
评论 #33804623 未加载
评论 #33805214 未加载
评论 #33804425 未加载
评论 #33804387 未加载
评论 #33929999 未加载
评论 #33810030 未加载
评论 #33809082 未加载
i_am_toaster超过 2 年前
I would be willing to drink the kool-aid if I saw it being used in a practical way. I always feel these posts are filled with category theory jargon without ever explaining why any of the jargon is relevant or useful. I’ve even watched some applied category theory courses online and have yet to feel I’ve gained anything substantive from them.<p>However, as I started off with, I’m always willing to try something out or see the reason in something. Can anyone give me a practical applied way in which category theory is a benefit to your design rather than just creating higher level jargon to label your current design with?
评论 #33805559 未加载
评论 #33804680 未加载
评论 #33804730 未加载
评论 #33804719 未加载
评论 #33804800 未加载
评论 #33809388 未加载
评论 #33808145 未加载
评论 #33808221 未加载
评论 #33808340 未加载
评论 #33807397 未加载
评论 #33805196 未加载
评论 #33807030 未加载
评论 #33807224 未加载
评论 #33805923 未加载
评论 #33807162 未加载
评论 #33806117 未加载
rslice超过 2 年前
I strongly recommend this presentation: &quot;John Baez: &quot;Symmetric Monoidal Categories A Rosetta Stone&quot;[0]. It is easy to get lost in the ocean of theorems and definitions and overlook some powerful core concepts.<p>[0]<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=DAGJw7YBy8E" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=DAGJw7YBy8E</a>
评论 #33806549 未加载
chowells超过 2 年前
&gt; Category theory is really the mathematics of abstraction<p>Mathematics is the mathematics of abstraction. That&#x27;s all you&#x27;re doing in math, from the beginning to the end. What&#x27;s the same between &quot;I have two sheep in this pen and five in that one&quot; and &quot;I have two apples in this basket and five in that one&quot;? Hmm, you can abstract out 2+5=7, since it works the same in both contexts.<p>Everything in math is creating and exploring abstractions. The good ones tend to stick around, the bad ones tend to be forgotten.<p>Category theory is the mathematics of composition. How much knowledge can you throw away and create reusable patterns of composition? How many interesting things can you find by adding back the smallest bits of additional structure on top of that minimum? How well do those things compose together, anyway?
评论 #33810036 未加载
评论 #33812142 未加载
WFHRenaissance超过 2 年前
As a former category theorist: don&#x27;t learn category theory unless you&#x27;re already rich or want to do it for fun.<p>It will be a lot less rewarding than you expect RE: your engineering ability&#x2F;understanding.
评论 #33806868 未加载
adamddev1超过 2 年前
Bartosz Milewski&#x27;s series of lectures on YouTube is a really engaging and enjoyable introduction to category theory. These are really helping me get it. <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;playlist?list=PLbgaMIhjbmEnaH_LTkxLI...</a>
评论 #33812606 未加载
khazhoux超过 2 年前
As a programmer and hobbyist math reader, I found category theory to be very unrewarding (and I gave up on it) because of the lack of interesting theorems and lemmas. My takeaway was that there&#x27;s Yoneda lemma and really nothing interesting before you reach that. Like, CT describes a set of rules but very little emerges from those rules.<p>My complaint has nothing to do with whether CT is useful or practical. By contrast, abstract algebra can be taught (e.g., in Herstein&#x27;s books) as pure abstraction (very dry and without presenting any real-world connections), but you reach Lagrange&#x27;s theorem right away -- which is an simple-but-awesome result that will wake up your brain. You reach Cayley&#x27;s theorem and others quickly, and each is more exciting that the last. And this is all while still in the realm of purely-abstract math.
评论 #33813814 未加载
评论 #33806661 未加载
thr3ads超过 2 年前
I became very interested in CT from a biological perspective. The work originates from Robert Rosen who describes how biological&#x2F;complex systems are not (completely) reducible to formal systems (aka any model of a natural system will always be incomplete+it is impossible to explicitly list out all the rules governing the system) because they &quot;contain a model of themselves&quot; to which they anticipate the future and act on towards their benifit.<p>Many relate his work as closely tied to Gödel&#x27;s incompleteness theorem but for biology. The purpose of using category theory is that it is general enough to not talk about specific parts of an organism&#x27;s construction, but rather how their general functional parts relate to each other.
kevinventullo超过 2 年前
This crowd may not want to hear this, but as a former mathematician, the DS&#x2F;Algorithms knowledge I gleaned from Leetcode grinding has been far more useful in my day-to-day work than any of the category theory I once used on a regular basis.
评论 #33809896 未加载
schwurb超过 2 年前
I find CT highly fascinating, worked through parts of 7 Sketches in Composability and have a functional programming background. I see the appeal, but I came to the conclusion that my time is better spent observing, learning about and designing with abstractions like monads, applicatives and so on rather than to learn the theory behind it.<p>There seems to be a tiny handful of people that can use category theory as a resource to craft something relevant to software (the stereotypical example in my mind being Edward Kmett of Haskell Fame), but I am certainly not one of them, and that is not something that would change with learning more Category Theory (whatever that might mean: Proving some theorems, discovering more categories, ...)<p>To the author: I am looking forward to a retrospective at a later time. I wish you a good journey, happy diagram-chasing!
Twisol超过 2 年前
&gt; Category theory is literally the mathematics of boxes (objects), arrows (morphisms), and composition.<p>As I&#x27;ve learned more about category theory (and its applications), I&#x27;ve found <i>string diagrams</i> to be a really nice tool. But string diagrams flip the above around -- morphisms are <i>boxes</i>, and objects are <i>wires</i>. A wire is just a point-to-point link; it doesn&#x27;t do anything on its own, it just connects a port of one type with a matching port on another site. It&#x27;s the graphical realization of the composition operation itself.<p>Meanwhile, morphisms are the things that actually have behavior and real identities, so we draw them as boxes with inputs and outputs and give them names. This lines up with my understanding that in category theory, it&#x27;s the <i>morphisms</i> that matter; the objects are no more than labels governing how you can stick the morphisms together. You may as well call the morphisms &quot;widgets&quot; or &quot;components&quot;, and call the objects &quot;interfaces&quot;, because that&#x27;s literally correct.<p>This ends up really nice in the context of distributed systems, where concurrency gives you a <i>monoidal</i> category. In string diagrams, concurrently is quite literally the result of putting two diagrams side-by-side, rather than connecting them end-to-end. It&#x27;s lovely, and some of the research I&#x27;m doing right now is actually founded on formalizing the message-passing causal diagrams distsys researchers and practitioners use every day, and using them as a vehicle for building programs that are more amenable to being proven correct. (Distributed systems are hard to verify for both humans and computers; I&#x27;d like to think that what I&#x27;m doing will be just as good for giving human practitioners a good framework for convincing themselves their code is correct -- or better, making bugs more obvious.)
评论 #33811285 未加载
charcircuit超过 2 年前
Honestly, this is a waste of time and is not going to help as much as the author thinks it is. There is no secret from category theory that will make one&#x27;s design 10x better. Not everything is even applicable.<p>&gt;I hope that category theory will allow me to formalize my intuitive understanding of abstraction, put words to it, and use those words (or, better, words others have written) to explain my thinking.<p>Note how this goal doesn&#x27;t include anything about improving the author&#x27;s software engineering ability. The goal is to be able to use category theory to describe existing concepts. Why not us just describe it in ways that 99% of software engineers already understand? Why not learn good software design directly instead of through a subset of category theory which you have to translate?
评论 #33804155 未加载
评论 #33804184 未加载
sargstuff超过 2 年前
Category theory is very helpful when looking a programming from a metadata &#x2F; multi-domain interactions perspective aka (interaction between different abstraction layers &#x2F; non-linear scip )<p>Although, applying CT to lisp ( . ) bit more handy (to quot(.) or quote()
评论 #33929963 未加载
mark_l_watson超过 2 年前
Cool, I am also spending a little time on this. I bought a CT book by Emily Riehl but I am finding it rough going.<p>I find her YouTube talks and lectures to be easier to follow.
评论 #33805083 未加载
qubex超过 2 年前
As opposed to “why am I learning category theory”, which is usually screamed deep in the night before an exam.
aleyva超过 2 年前
Super cool-- love the discussion around diagrams and why they&#x27;re so critical to humans
Throwaway23459超过 2 年前
I worked through a popular Introductory Category theory text. Did all the problems and made sure I understood everything in there really. It became clear by the end why some mathematicians like category theory. It lifts some results in certain areas to a higher level of generality.<p>As for me it helped me with understanding some of what was being discussed on r&#x2F;haskell. It didn&#x27;t help one iota getting me a Haskell job though, failed every Haskell code pairing I&#x27;ve done.
antimora超过 2 年前
I recommend &quot;how to bake pi&quot; by Eugenia Cheng for a high level introduction, followed by her in-depth (but still approachable) book &quot;The Joy of Abstraction&quot;
criloz2超过 2 年前
I am also in the process of learning cat theory, I don&#x27;t have a cs background, but I ending working as full-stack developer because it was economically more rewarding, I will recommend to programmers to have a good understanding of set theory, binary relations and order theory (linear orders, partial orders, lattices), it gives you very powerful abstractions that allow you to write new algorithms about anything.
评论 #33807599 未加载
IntFee588超过 2 年前
You learn category theory for intellectual curiosity. I learn category theory to pass a Haskell course. We are not the same.
yodsanklai超过 2 年前
Reading at the comments, people confuse concepts like monoids and functors with category theory.
评论 #33810076 未加载
评论 #33806469 未加载
评论 #33808218 未加载
justinhj超过 2 年前
Category theory? Learning something when you don’t absolutely have to in order to write code? Sure it might be fun and expand your mind but I’ll have none of it you understand! Bah humbug!
OgAstorga超过 2 年前
Related discussion. <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33740089" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33740089</a>
xupybd超过 2 年前
I tried this a couple of years ago. However it went over my head I think I need more fundamentals before I can approach this again.
donkey-hotei超过 2 年前
My professor told me that learning category theory would make me a better person but not a better programmer
oxff超过 2 年前
To obviously debunk any and all FP autism coming at your way.<p>To give credit where credit is due, most of the time some application functionality being described through FP jargon gives a better spec of its behavior than the same through OOP jargon.
评论 #33806568 未加载
nnoitra超过 2 年前
Will it make you a better React dev tho?
评论 #33803670 未加载
评论 #33804637 未加载
评论 #33805574 未加载
评论 #33805825 未加载
edgyquant超过 2 年前
I’ve become increasingly obsessed with set theory. I think we can derive set theory from Turing machines and basically “solve” incompleteness.
评论 #33812541 未加载