Hacker News new | past | comments | ask | show | jobs | submit | tezka's comments login

Any body can share a success story of using category theory gainfully to any CS/SWE problem that couldn't have been solved without? No Monads isn't one, you would invent it naturally when the situation calls for it. I spent a year studying in grad school and I ultimately abandoned it.


There are no problems that can't be modeled without category theory. One of the most foundational category theorems is the Yoneda Lemma, which directly states that any problem phrased in the language of categories can be translated to the language of sets and functions. The same is true of every mathematical object with a definition in terms of sets - you could always replace the name with its definition.

The contribution of category theoretic language to the implicit framework of a theory can't be larger than the definition of a category, which is very small. You could be asking "why use groups when sets with an associative operation exhibiting closure, an identity and an inverse are more approachable?" Abstract algebra is based on a library of definitions that refer to types of operations on sets that are simple enough to be common. A tool or a technique are not the kind of things you can find in a definition.

Rings, vector spaces and modules get a sort of instant acceptance for what they are, but categories have believers and disbelievers. I am curious about how that can happen.


It is because without vector spaces, you could not do linear algebra, which you need for everything. Without categories, you cannot do category theory, which you need for ... what exactly?


Of course you can do linear algebra without vector spaces. Leibniz didn't know about vector spaces, yet he was doing linear algebra. It just happens that the use of vector spaces massively helps thinking about linear algebra problems. CT is applied to many domains. For a concrete example look up ZX calculus, which is used to optimize quantum circuits.


> It just happens that the use of vector spaces massively helps thinking about linear algebra problems.

That is the point here.

> CT is applied to many domains.

Yes, but in which of those does it massively help? I just looked up ZX calculus, and I am sure you can formulate that better by not mentioning CT at all.


> I just looked up ZX calculus, and I am sure you can formulate that better by not mentioning CT at all.

Based on what? Sorry, but what you're saying is beyond arrogant (considering you have zero knowledge of the subject).


As usual, quick googling reveals that the ZX calculus is really just a CT repackaging of Penrose diagrams, which were discovered and used without any involvement of CT.


You may be interested to know that I made an earlier comment about the ZX Calculus in the thread.


I can accept that meaning of the word necessary for the purposes of discussion. Category theory is needed to compose functions.


I can compose functions just fine without category theory. I do it all day long, in fact.


The closest I know of is the work on UMAP. I interviewed Leland McInnes who explained to me in detail how category theory was a big part of helping him connect the dots, even though the final result does not strictly need it in the actual code. Given the relative improvement over the previous state of the art (t-SNE), it's the only example that really makes me reconsider my poo-pooing the way category theory is discussed in software.

https://arxiv.org/abs/1802.03426


For an alternative POV, quite critical of UMAP, see: https://doi.org/10.1371/journal.pcbi.1011288


Yes, but I think that it can stand as an answer to the OP regardless of the techniques status as useful for particular domains


I felt UMAP and its limitations were explained in a friendly way here https://topos.site/blog/2024-04-05-understanding-umap/ - written by someone who understands the category theory but is able to explain it without using any category theory.


Fascinating.

More on the topological data analysis:

http://outlace.com/TDApart1.html


"Anybody can share a sucess story of using a car to go places I couldn't have gone on foot"?

CT is a language and a tool, meaning anything you can say in the language of CT you can say in other languages.

Like cars, if you learn how to drive it (and this one has a very steep learning curve), it gets you places faster, but you there's in principle nothing stopping you from going there walking, i.e. without specifically referring to any CT concepts.


Reformulating something you already understanding in a more general framework can give more insight into what it really means, isolate the essence from messy details. From my very limited understanding of it, characterising an object with universal properties is an important part of category theory.

Another practical utility of category theory is providing a common language for computer scientists, mathematicians and physicists to speak. You can imagine collaboration is not easy when everyone calls the same pattern with different names with slightly incompatible definitions that requires you to understand unfamiliar theories.


> is providing a common language for computer scientists, mathematicians and physicists to speak

The cat theory framework is too high level to usefully exchange ideas between these fields. The consensus in academia seems to be that it is a nice "party trick" framework that has very limited insights or expressiveness in actual physics/CS problems.


Historically, Category Theory was developed to formalize and better understand some deep methods used in mathematics. Like much of mathematics, it "automated" some types of reasoning, opening possibilities that did not (practically) exist before. There are some areas today that cannot even be properly understood without thinking in categorical terms.


I would like to second this take, as someone who found it very useful while writing up my masters (in logic). When you're working with objects that satisfy lots of universal laws (particularly algebras, logics, stuff like that) CT can be used to remove tons of "boilerplate" in your proofs for things that are basically trivial/routine but a pain to state and prove formally. As an example, imagine a construction where you extend the underlying language of some logic (like adding additional constant symbols in, for instance). Strictly speaking, to "transfer" results into this new logic you need to do a bunch of tedious proof to show that everything goes through the way you would expect. Category theory can make expressing and working with this class of thing (and many others) very expedient.

It's a bit like working in a framework that has great primitives for the stuff you do a lot. Like think dependency injection for constructing instances. Saves you tons of coding time in the long run.

Of course, this point of view is probably hard to appreciate from outside the priesthood =P.


Yes it did, except all of those examples where it convincingly helped were super-advanced, very hard to comprehend, and lacking in non-niche applications to CS or physics.

There is a category theory "school of thought" in certain subjects, but it's usually a speculative belief in the importance of category theory.


Improving communication between experts in a niche discipline is also a value-add, in my opinion (and my experience, for whatever that's worth). There's no need for it to have mass appeal to be useful.


At the Topos Institute we're working on some new software that we're hoping will be a lot more transparent to people who haven't drunk the CT Kool-Aid yet; the current pre-alpha is mainly for systems dynamics modeling but the category-theoretic basis is, to my mind, indispensable for the range of tasks we're targeting. I'd be very happy to hear anybody's thoughts! https://topos.site/blog/2024-10-02-introducing-catcolab/


You are very close. CT is about structure, not which problem this structure solves. Compilers are closest in what i can think of in this regard: They don't resolve one problem domain, but many. Which one you apply it on is up to you.

One tool for one job is a simple rule you can adapt as a systems architect allowing you to build clear structure for the problem domain you come across. esbuild comes to mind as an example - the job was solved before, but keeping one purpose in mind and writing it from scratch solves the problem WAAAY faster.

So no, no problem is solved inside the domain of product software development, but outside of it, you as a developer can (if you want and for speed) derive any structure from the absurd function instead of combining foreign frameworks.


> CT is about structure

No, this is exactly what CT is not about. (It is about morphisms.)


From Milewski: "That’s because category theory — rather than dealing with particulars — deals with structure. It deals with the kind of structure that makes programs composable."

And he is right, because morphisms may or may not preserve structure. If you want to nitpick and create structure from the absurd function morphism - then yeah, so I think a discussion about this gets tedious. The more you look into the matter the more structure / data and morphisms merge and your point feels more like an invitation for the newbies to have a mental breakdown.


Determining whether something is useful because it’s the only way that a problem can be solved is quite a high bar.

We could say the same about computers in general.

Admittedly even with a less stringent criteria I don’t have any examples. So I understand your point


Brainfuck is turing complete, why would we worry about any other structure preserving compilers? Brainfuck will do just fine /s

CT is outside most problem domains in computation, as its outside the time and space constraints of a machine. Knowing whether a program will never finish is part of CT for software developers. So handling this case is a maybe in CT while it's a must in software (running endlessly means crashing).


I've heard of some database migration tooling that uses category theory to compute robust data transformations that are automatically composable to achieve the desired outcome.

There has been seen some research into the fundamentals of machine learning, using category theory approaches for computing the compositions of transformations of expressions. E.g.: simultaneously computing a gradient, the "bounding box" of the error, and other similar derivatives to improve the robustness of gradient descent.


> any CS/SWE problem that couldn't have been solved without?

Any computing problem that could be solved with category could be solved by brainfuck.


My cynical understanding of category theory is that it's the mathy Peter principle: category theory is when meta mathematics starts to lose all value. Except two professional mathematicians, of course, in which case the value is almost purely economic. "He who is employed to teach something that cannot be understood will always have a job."


It is really not useful at all in software engineering except possibly in some very niche case.


abstractions never solve problems that couldn't have been solved without them.


Sure; it's just that doing calculations with the Roman numerals takes longer.


Roman numerals are too abstract a representation of counting. I use potatoes.


~”numbers are the abstract notion, the primitive way of counting is a bijection” W. Lawvere

so the way people use “abstraction” sounds more like they are saying “a thing we (we think) are not used to”


> but as a Brit coming from somewhere with a by then thriving real ale scene,

Served at room temperature. Yikes.


You can buy more than Ale in the UK.

Out of all countries I've been to, New Zealand has the best craft beer scene though, imo.


Served at cellar temperature, so around 55 F, sometimes cooler.


Blade Runner is not a Kubrick film.


You're right. My mistake for lumping that in there.


It's one of his most accessible movie, and usually resonates with tech people for obvious reasons. His best movies imo are Mirror, Ivan's Childhood, Andrei Rublev, Stalker and then Solaris, Nostalgia and Sacrifice.

Now Solaris book by Lem is far superior to Tarkovsky's rendition.


how is it related to any of these? do you have links to articles?


Insights from famed algebraic geometer and Fields medalist David Mumford, who has also worked (and co-authored a book) on Pattern Theory (statistical computer vision). https://en.wikipedia.org/wiki/David_Mumford


What is NLL for 32x32 Imagenet? Thats a common benchmark and it’s strange that it’s missing from this paper. Also, will you release cifar10 samples? Curious what they look like at 2.80


What’s so hard about putting this at the beginning of the function? import pdb; pdb.set_trace()


But also learn one or two languages that fit your domain of work, really really well. I have seen too many programmers that justify their lack of skills in their main language they are supposed to know by bragging about their knowledge of some hipster language they rarely use. "my code is way too slow, but hey I know the syntax of dependent types in Agda..."


Thats not particularly a European perspective. Sounds like its just yours.


It is just mine, and I am European. I believe it is informative to spell it out in a discussion that points fingers at the (American) suburb.


your statement sounds like this is a point of view taken by the majority of people who live in Europe. Simple facts about the number and density of cities through out the history of the continent point to the exact opposite.


And they already told you they didn't mean it that way. Maybe listen to them, adjust your expectations, and move on?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: