News for hackers. Stuff that matters.
Re:Why I am learning category theory by ukj on Wednesday November 30, 2022 @03:44PM (#33807397)
Category theory is to functional/declarative programming what design patterns are to OO programming.

Patterns for decomposing problems and composing solutions.

To ask “How is it useful?” Is to ask “How are design patterns useful in OO?”.

But you already know the answer…

Is there an advantage over just inventing your own vocabulary? Yeah! You don’t have to reinvent 70+ years of Mathematics, or teach your language to other people before you can have a meaningful design discussion.

Re:Why I am learning category theory by charcircuit on Wednesday November 30, 2022 @09:15PM (#33811414)
>You don’t have to reinvent 70+ years of Mathematics

What do those 70 years of mathematics do for me as a software engineer?

>or teach your language to other people before you can have a meaningful design discussion.

It's the other way around. Most engineers will have no clue what you are saying.

Re:Why I am learning category theory by ukj on Wednesday November 30, 2022 @10:48PM (#33812090)
>What do those 70 years of mathematics do for me as a software engineer?

You mean other than inventing the entire industry in which you now make a living? It's a weird question that I have no idea how to answer for you.

What is 70+ years of computer science doing for you as a software engineer? Are you standing on the shoulder of giants; or are you inventing/re-discovering everything by yourself from first principles?

>It's the other way around. Most engineers will have no clue what you are saying.

That's no different to a world where every engineer invents their own meta-language to speak about their designs - two or more engineers still can't understand each other unless they develop a shared language; or learn how to transpile (code switch) between their meta-languages.

This is what happens with humans by default unless you intentionally become part of the Mathematical community which has been developing meta-languages for millenia and benefit from the network effect. It's an anti-entropy thing.

There are many parallels here to the Tower of Babel.

Re:Why I am learning category theory by charcircuit on Wednesday November 30, 2022 @11:48PM (#33812468)
>What is 70+ years of computer science doing for you as a software engineer?

No, what does category theory unlock from mathematics that I can not get without it.

Re:Why I am learning category theory by ukj on Thursday December 01, 2022 @12:21AM (#33812649)
Nothing. You can re-invent and re-discover everything. By yourself. From first principles.

You can re-discover and re-invent all of computation, Mathematics and physics.

You can do absolutely everything all by yourself. All you need is infinite time.

Re:Why I am learning category theory by larve on Wednesday November 30, 2022 @10:52PM (#33812112)
I'm not sure if this is supposed to be sarcastic, but taking it at face value, mathematics are the underpinning of both computer hardware and computer science. Since we are talking about more abstract mathematics, it is what gave us the lambda calculus, complexity analysis of algorithms, type theory, relational algebra, distributed systems.

more pragmatically, libraries like redux, react are heavily influenced by concepts from functional programming, rust has novel concepts from type theory, data engineering in the cloud age leverages a lot of algebraic concepts to achieve massive data throughput. We have parser combinators, lambdas, stronger typing, map and flatmap in most languages these days. These all come directly from mathematics.

Re:Why I am learning category theory by charcircuit on Thursday December 01, 2022 @12:07AM (#33812575)
>redux, react are heavily influenced by concepts from functional programming

Functional programming concepts don't require learning category theory

>rust has novel concepts from type theory

Type theory isn't category theory. Rust's borrow checker was not inspired by affine types.

https://smallcultfollowing.com/babysteps//blog/2012/02/15/re...

>data engineering in the cloud age leverages a lot of algebraic concepts to achieve massive data throughput

This doesn't requite category theory and those are basic concepts from algebra that you can learn outside of the context of algebra.

>We have parser combinators, lambdas, stronger typing, map and flatmap

These don't require category theory either.

Re:Why I am learning category theory by larve on Thursday December 01, 2022 @12:26AM (#33812681)
Oh, I thought your point was that mathematics wasn't bringing anything to computers. As far as I understand it, category theory is more about finding commonalities across mathematical fields (or indeed, scientific / engineering fields), more so than solving more concrete problems.

What does that give you? For me, I think it gives me an easier way to see common abstractions across different problems I work on.

I am at the beginning of my CT journey itself, but a layman's understanding of monads, functors and applicatives gets me really far writing pretty much the same code when i do bare-metal embedded or frontend javascript. The point is not that I couldn't write bare-metal code or frontend code without, is that I am much quicker seeing "my javascript promises are like a monad" and "my coroutines are like a monad" and being able to shrink my cognitive load.

Re:Why I am learning category theory by ukj on Thursday December 01, 2022 @12:51PM (#33819802)
>Functional programming concepts don't require learning category theory

This is such a reductionist world-view. Programming concepts don't require you to learn the theory of computation either, but having a theoretical/abstract grounding for what computation is disconnected from any particular programming language/model of computation helps. A lot.

>Type theory isn't category theory

It depends on what you mean by "isn't".

There is a 1:1 correspondence between type theory and category theory constructs.

https://ncatlab.org/nlab/show/computational+trilogy#rosetta_...