25 karma · joined April 25, 2019
Categories specifically contain "morphisms". Then FP completely gets category theory wrong by trying to claim that functions are immutable. Which is it?
Instead of chasing strawmen, why not address some of the issues raised in the article directly? Code reuse? Integration? Use of convergence hardware? Interactivity?
Forth is a tad exotic. Multix lets you use ordinary Typescript/Node
For a while, FP noobs were terrorized by a bunch of FP thugs on Twitter
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.
This version incorporates HN feedback from earlier A-B testing article aimed at the FP community. Mainstream programmers don't really care all that much about FP. It's pretty clear to me now that Cats and FP serve different markets anyway
Earlier version here (I think the article is now flagged anyway) but such is the nature of the interwebs that only controversial articles get attention https://news.ycombinator.com/item?id=31957194
Not mainstream programming for sure
For example, suppose you just need to isolate and test a function but you won't want to manually write a test harness
A crafting system could build the upstream dependencies and then deliver you the results - no code changes needed
Cats kinda live between trad code and databases, so they are really good at integration across systems. Zapier and other no-code approaches are nice but don't go deep enough and eventually you hit a wall. So cats are the "next level" down from such systems without having to abandon such tools entirely and go back to the old ways
And those concerned with speed on hardware are probably not the ones who want the flexibility and interactivity of high level languages
Remember that coming up w the names for types is half the battle. Whether something is a "string" or an "Address" or an "InputField" is really a multi-dimensional type problem
The nice thing about crafting is that stuff gets cached in inventory as a side effect. You can toss inventory as a way to clear the cache
The fact the HTML might sit on a remote server is a crafting detail left to the categorical machine
I have some examples on Twitter
So in a way, if you go through all the work of setting that up you should be rewarded with some sort of crafting. After all, the type checker is kinda doing some of that work anyway
However functions still have single entry/exit that limit reusability of the contents
Cat crafting > FP because it can avoid functions entirely
One real world example I am doing for a large customer is data integration across 10-20 large databases and APIs. Categories are ideal for this because they give you the adhoc interactivity of what you would get with SQL but when I am dealing with a bunch of different vendor databases, SQL is not an option. Plus I need to join against APIs and would rather use Typescript for that
A simple example of "crafting" is to resolve the database "connection" parameter to a routine. The problem with working w databases is that every query expects you to have established a connection first - and the minute you make a code change, you lose your database connection(s). This gets much harder when dealing with joins across 10-20 databases at the same time
Then what do you do w the results? Well, you probably want to cache them. This is where persistent memory comes in
My DB query results - regardless of the database - are usually a Typescript array - and I am not about to stuff them into another database. But I don't want to lose the array from memory every time I make a code change either. Persistent memory is a good place to stuff that array
But that's why I boiled things down to Minecraft style crafting. Mainstream programmers don't have time to learn category theory or dependent type theory etc. ... or even care.
The Lambda Conference stuff caters to a small group of programmers that are already happy with FP etc. for whatever they are doing (usually program verification, not mainstream coding)
There is a notion of "categorical thinking" where you try to free your brain from the urge to compartmentalize. Imagine the smartphone example
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
The main claim is that crafting > functions because crafting does not have the single entry/exit drawback that functions have
Miami is WAAAY cooler
Enjoy this article before it gets pulled
Actually 1960s
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
Reducing or eliminating "functions" means reducing or eliminating the refactoring problem