Hacker News new | ask | show | jobs
by ebingdom 1452 days ago
This article is completely incongruous and reveals fundamental misunderstandings of category theory. That's actually being generous; most of the content isn't even coherent enough to be wrong.

> Category Theory (at least applied to computing) studies how instructions are assembled into running programs.

Um, no? As a software engineer who has studied category theory, I use it mostly for denotational reasoning about programs, and to inform type-level decisions. It has nothing to do with "instructions". Perhaps a generous interpretation of this statement would be that monads, one very specific concept in category theory, can be used to model imperative programs—but that would be highly reductionist.

> That’s not to say that FP is useless. FP is obviously quite useful in many situations - but perhaps not be enough to displace the central role of wrapper functions / lambda calculus.

What? Functional programming _is_ lambda calculus. The idea of it displacing lambda calculus makes no sense.

> Why? Mathematically speaking, Category Theory is basically the same as Relational Theory (at least applied to Sets).

Oof. Rel is one category; Set is another.

> There is this fanciful notion of a “computational trinity”- the idea is that devs can somehow write to a single source of “truth” and let artificial intelligence / automation decide how it gets translated to hardware.

No, the trinity refers to the connections between category theory, logic, and programming. It has nothing to do with AI.

Was this article written by an AI?

3 comments

> Was this article written by an AI?

This is my first thought too. The author sounds like they know FP by swallowing all kinds of info about it from articles around the net regardless of them being right or wrong.

FP > lambda because it avoids wrapper functions by using chains

However functions still have single entry/exit that limit reusability of the contents

Cat crafting > FP because it can avoid functions entirely

> However functions still have single entry/exit that limit reusability of the contents

I argue that is due to granularity of function implementation. After all, if I have:

f(x) = 2x + 3

That is really

g(x) = 2x

h(x) = x + 3

and f(x) = h(g(x)). So by breaking the function into irreducible pieces I have achieved maximum reusability.

It seems like the core argument here is that if we (effectively) break down all functions into their smallest granularities and have some sort of ability to (SQL) "SELECT" / project / join those functions together we'll enable some sort of higher-level ability to construct complex software.

There are three reasons I disagree with this:

1) The universe of irreducible functions is infinite.

2) The universe has state and evolves. This means that the (SQL) "SELECT" / project / join of functions described above must itself necessarily change its behavior with the evolution of the universe, and I suspect this (in itself) is an intractable problem.

3) From an API perspective, 99% of the APIs today do not even form a category. That is, I cannot directly connect one object (API) to another object (API) because no morphism currently exists to enable me to do so. Worse, what that morphism is depends on the product of the domain and range of the APIs being connected. Automatic code traversal via some sort of SELECT is doomed to failure unless the set of morphisms is complete. The alternative is to try to automatically generate the correct morphism based on the SELECT...

... and that is exactly what software developers do. So while Multix has some interesting features built into it, based on the above it appears that the goal of the research is to essentially build a god-like AI that writes the software for us. I think that's really why there is abundant skepticism here.

Yes, there is a long-standing debate in categories about this "reduction" problem but that is mostly theoretical

In practice, you only need to break down enough to interface w existing APIs

The morphisms are controlled by the crafting system, which is really a higher order type system

No you don't need to achieve god-like powers any more than GitHub is the source of all code on the planet (it doesn't have to be all or nothing).

Even the crafting rules themselves contain FP chains. In my real world work, I use a mix of crafting, FP chains and old school functions.

you may be right but i think you're doing it wrong
I would invite everyone to look at the Multix categorical machine. The FP style chains and crafting work wonderfully even over a network https://portal.multix.catatonic.ai/
Why?
You as the developer are the one who has to decide which tech is worthy of your attention. And Cats are trying to compete with FP for your attention

Reducing or eliminating "functions" means reducing or eliminating the refactoring problem

You are behaving defensively and a bit irrationally
Fair enough, I needed to improve the answer

The main claim is that crafting > functions because crafting does not have the single entry/exit drawback that functions have

Categories are chains of morphisms

If you don't get that, maybe you missed something in your training

And yes it has everything to do with AI (not categories per se but the article)

Categories are objects and morphisms with identities and composition, subject to some coherence laws characterizing identities and stating the associativity of composition. Category theory studies categories and related constructions, such as functors, natural transformations, adjunctions, (co)limits, universal properties, etc.

> And yes it has everything to do with AI

No, category theory is not about AI. My training was certainly sufficient for me to refute that connection, and the way you keep referring to my "training" rubs me the wrong way.

Categories are about composition. Crafting is also about composition - using inference rules. https://en.wikipedia.org/wiki/Category_theory

The classic schematic representation of X Y Z shown on the above wiki page is basically a crafting rule to create Z. That is, if the AI knows about a "path" (think back to your homotopy training) from X and Y to Z then it can craft a Z from X,Y if it needs to

> it has everything to do with AI

Could you elaborate on this? What does it have to do with AI?

Do you have any Prolog background? Inference rules? Armstrong's axioms etc.?
For the laymen's in the audience such as myself can you answer the question.
(repost from similar question above)

Categories are about composition. Crafting is also about composition - using inference rules. https://en.wikipedia.org/wiki/Category_theory

The classic schematic representation of X Y Z shown on the above wiki page is basically a crafting rule to create Z. That is, if the AI knows about a "path" (think back to your homotopy training) from X and Y to Z then it can craft a Z from X,Y if it needs to

Yes this is exactly reverse to how we normally think about the caller/callee relationship

I usually just upvote. But I'd like to take the time to thank you for responding. Have a good one.