News for hackers. Stuff that matters.
Re:Applied Category Theory Course by mjan22640 on Thursday September 28, 2023 @02:42AM (#37686146)
Programming is applied algebra, the choice is not using vs not using, but understanding what you are doing vs being ignorant about it. Relevance is in the eye of the beholder. In typical business the incentive is to have a good enough code ready "yesterday", and it will be thrown away tomorrow, as the code and whatever it does are only a means to generate profit and not a goal in itself, and spending time on making it profound is a waste. Wrt production examples, anything written in haskell used categorical constructs explicitly.
Re:Applied Category Theory Course by mjburgess on Thursday September 28, 2023 @04:41AM (#37686963)
Programming is also applied physics. But understanding the kinetic forces behind typing is no guide to improved programming.

To say that learning a field is useful is to say that knowing these abstractions is useful.

Much of Haskell's "category theory" is a reuse of terms. Replace Monoid by Appendable, Monad by Composable, Functor by Runnable, etc. and most programming languages are "category theory".

This says little about whether knowing the field of category theory will be useful to programming. Indeed, I think there's a good argument to say Haskell programming is much harmed by it.

If its authors hadnt used their knowledge of category theory, but rather named the abstractions in more ordinary terms, the language would be more useful to more people.

Re:Applied Category Theory Course by mejutoco on Thursday September 28, 2023 @06:51AM (#37687782)
> If its authors hadnt used their knowledge of category theory, but rather named the abstractions in more ordinary terms, the language would be more useful to more people.

The language would be just as useful, but it might _feel_ more approachable. Depending on the terms that replaced those it might be more confusing, or the opposite, than it is now.

Re:Applied Category Theory Course by almostdeadguy on Friday September 29, 2023 @12:40PM (#37706731)
> Replace Monoid by Appendable, Monad by Composable, Functor by Runnable, etc. and most programming languages are "category theory".

I'm not sure an "Appendable" Int or IO type, or a "Runnable" / "Composable" List type is any less confusing to Joe Programmer. These descriptions do not articulate the same things implied by the Monoid, Functor, and Monad laws. Some of these aren't even correct (i.e. not all Functors are "Runnable", Monads do not necessarily compose directly, just via Kleisli composition).

> This says little about whether knowing the field of category theory will be useful to programming. Indeed, I think there's a good argument to say Haskell programming is much harmed by it.

> If its authors hadnt used their knowledge of category theory, but rather named the abstractions in more ordinary terms, the language would be more useful to more people.

I think this is really the least of Haskell's problems. Mystifying/poorly written monad tutorials and conflation with IO (or confusion about how IO works in the haskell runtime) is more responsible for confusing new programmers than the concept itself. I have no background in mathematics above undergrad calc 2 and I was able to understand them just fine.

Re:Applied Category Theory Course by mjburgess on Friday September 29, 2023 @01:56PM (#37707887)
I take it all Functors are runnable if you see (1) map as generalised function application and (2) functors as lifted map.

The concepts, at the level of abstraction i just use there, are confusing. Thinking this abstractly about programs actively impairs programming in many cases.

This level of 'unification of syntax via abstraction' is relevant only really to language designers.

Re:Applied Category Theory Course by stiff on Thursday September 28, 2023 @04:53AM (#37687033)
Programming is applied algebra just like tying your shoes is applied knot theory :)
Re:Applied Category Theory Course by epgui on Thursday September 28, 2023 @09:06AM (#37689085)
IMO, knot theory is not as closely related to shoe-tying as programming is to algebra...