When it comes to types, python is arguably easier to reason about than typescript, given that the in-code types are just for reference.

Typescript types can break even when they are actually valid. But it takes some intuition to know when to use the escape hatches, so I can see why an LLM would have trouble with it.

I wonder if LLMs would write javascript better than typescript too.

Reply to this note

Please Login to reply.

Discussion

Types are definitely a stumbling block for LLMs. I think you are onto something there.

My personal guess is that there’s just so much crappy TypeScript code out there that without a ton of guardrails it’s just a pasta machine.

Second to that is the lack of understanding of category theory which IMO needs some level of reasoning.

TS & CT? where? 🧐

What’s CT?

Category Theory

Ah, gotcha. What was your question?

Oh, just curious how category theory and typescript are intertwined.

Well, more like type theory has to do with category theory. It’s One of the first things you’ll like encounter when learning functional programming. Type operations, follow the rules from category theory (from math).