Sign in

Matt Pocock

@mattpocock.com
15K followers 304 following 611 posts

Full-time TypeScript educator. Used to be a voice coach. He/him. Author of Total TypeScript 🧙 Hire me to teach your team TypeScript!

PostsRepliesMedia
Matt Pocock @mattpocock.com · 27/05/2025
Some smoooooooth template literal types spotted in Vercel's Chat SDK Gives you automatically typed error codes for multiple features at once.
2663
Matt Pocock @mattpocock.com · 26/05/2025
Hilarious use case for a mapped type: Use it to rename an object key your backend developers consistently misspell parms -> params
3421
Matt Pocock @mattpocock.com · 08/04/2025
Spotted in the wild today: a Mutable<T> type. Does the opposite of Readonly<T>. Weird that TS doesn't have this built-in.
3501
Matt Pocock @mattpocock.com · 01/04/2025
Two cool things in this snippet: 1. You can use 'glob' from Node instead of a library! (still experimental, available in 22+) But glob returns an async iterator, which can be annoying to work with. So... 2. Array.fromAsync lets you turn an async iterator into an array. Beautiful.
510411
Matt Pocock @mattpocock.com · 26/03/2025
"The AI Engineer Roadmap" dropping soon. Covering everything you need to enter the AI world: - What LLM's are used for - The AI engineer mindset - Evals - 17 techniques for improving your LLM-powered apps
2465
Matt Pocock @mattpocock.com · 23/03/2025
I have worked with TypeScript for 7 years. I have written a book, produced 5 courses, made countless videos and articles, and delivered workshops about TypeScript. And today I learned that TS can do this:
5710
Matt Pocock @mattpocock.com · 21/03/2025
It's the evals, stupid
3281
Matt Pocock @mattpocock.com · 21/03/2025
Trying to define an agentic loop in the fewest amount of words.
4233
Matt Pocock @mattpocock.com · 12/03/2025
Nearly ready...
0280
Matt Pocock @mattpocock.com · 04/03/2025
Next.js, do you even know who I am?
5740
Matt Pocock @mattpocock.com · 03/03/2025
Jina's open source DeepSearch implementation is fascinating, but SUPER hard to read. So, as a research project, I refactored the code to make the underlying logic clearer.
2260
Matt Pocock @mattpocock.com · 14/02/2025
VSCode catching up with Cursor. Add this to get Cursor-like tab completions for suggesting the next edit.
6783
Matt Pocock @mattpocock.com · 13/02/2025
One fascinating decision with building LLM integrations is Agent vs Workflow. Agent: give the LLM control of execution. Slower, but better at a wider range of things. Workflow: use code to control execution. Faster, but more specialised. Ultimately, it comes down to the product you're building.
2241
Matt Pocock @mattpocock.com · 30/01/2025
Deepseek R1 is pretty good at TypeScript, y'all. These are its reasoning tokens, not the text emitted to the user.
3410
Matt Pocock @mattpocock.com · 27/01/2025
I've been messing about with a pattern where the agent persists small snippets in its working memory. This small change has a pretty huge impact on the user experience. Feels like your agent is really getting to know you.
0100
Matt Pocock @mattpocock.com · 20/01/2025
My first AI course is complete... And it's free! It's a 16-lesson tutorial on Vercel's AI SDK. It's the missing piece for working with AI in TypeScript. No bullshit, no hype. Just solid, practical advice. www.aihero.dev/vercel-ai-sdk-tutori…
813716
Matt Pocock @mattpocock.com · 20/01/2025
However much I focus on AI, the TS stuff keeps being relevant. This time, it's the AI SDK not providing a built-in type for tool calls - so I've got to extract it using: - Awaited<T>, to unwrap the promise - [number], to turn the array of tool calls to a single member
2360
Matt Pocock @mattpocock.com · 17/01/2025
🔥 Massive Content Drop 🔥 I'm open-sourcing AI Hero, the repo of material I'm putting together for my course. So far, there are 16 runnable examples on Vercel's AI SDK. Full tutorial dropping any day now. github.com/ai-hero-dev/ai-hero
14710
Matt Pocock @mattpocock.com · 17/01/2025
MattGPT, answering the important questions. - 100% TypeScript - AI SDK - Question-matching retrieval based on a custom dataset - Clack for beautiful CLI
4692
Matt Pocock @mattpocock.com · 16/01/2025
Yet another nice example of template literal types, spotted in the AI SDK codebase. This forces the 'size' property in generateImage to match `${number}x${number}`. Beautiful.
2562
Matt Pocock @mattpocock.com · 10/01/2025
LLM routers seem like a fascinating pattern to me. - Lets you separate concerns into different prompts - Makes your system more testable Really interesting for agents/workflows with several discreet concerns, like searching, handling git, and file editing.
3372
Matt Pocock @mattpocock.com · 06/01/2025
We're not messing about with AI Hero. Bringing everything the team has learned from Total TypeScript for an awesome AI course.
1210
Matt Pocock @mattpocock.com · 29/12/2024
Done something a bit cheeky on my latest package. If folks use it with an out-of-date tsconfig.json (that doesn't support entrypoints like my-package/a or my-package/b), I direct them to a .d.ts file like this: It still works at runtime, but on the type level it'll warn them.
61022
Matt Pocock @mattpocock.com · 28/12/2024
Two updates to the Node/TS announcement: - Node 22 WILL be getting TypeScript support by default. - Type-only namespaces (which I actually have started using and quite like) will be supported by default. www.totaltypescript.com/typescript-i...
413713
Matt Pocock @mattpocock.com · 17/12/2024
TSConfigs aren't that hard. They're basically just 2 if/else statements in a trenchcoat. More info: www.totaltypescript.com/tsconfig-che...
1215514
Matt Pocock @mattpocock.com · 16/12/2024
Now we're getting somewhere
0280
Matt Pocock @mattpocock.com · 10/12/2024
How clear is this headline? If you've never heard of Evalite, what questions do you have?
10150
Matt Pocock @mattpocock.com · 10/12/2024
Lick of paint. It's getting serious.
1430
Matt Pocock @mattpocock.com · 09/12/2024
Nothing beats building your own test framework, then watching all your evals hit 100%. Evalite getting better every day.
5400
Matt Pocock @mattpocock.com · 09/12/2024
Damn thing got me again
Bart Simpson writing "I will always check the generated code" on a chalkboard
3955
Matt Pocock @mattpocock.com · 08/12/2024
Everyone I know who fell in love with TS had a period of thinking it totally sucked
5534633
Matt Pocock @mattpocock.com · 05/12/2024
Looking for beta testers for Evalite. Want to try a local-first, TypeScript native tool for testing LLM-powered apps? (no API key required, folks) DM me your github username and I'll grant you repo access.
3222
Matt Pocock @mattpocock.com · 03/12/2024
I forgot how much I love breadboarding
A detailed diagram of an app for examining the output of LLM's.
4440
Matt Pocock @mattpocock.com · 03/12/2024
Evalite, my local-first, TypeScript native LLM test runner, is getting closer and closer to being ready.
8920
Matt Pocock @mattpocock.com · 02/12/2024
✨ Announcement Time ✨ I've been thinking about my next course for a while. Total TypeScript took two years to build. Its success completely changed my life. What's next? A TT-level deep-dive on AI. It's called AI Hero.
6673
Matt Pocock @mattpocock.com · 27/11/2024
Whoops, just made myself obsolete
10630
Matt Pocock @mattpocock.com · 21/11/2024
Post a non-religious photo you think of as holy.
2301
Matt Pocock @mattpocock.com · 21/11/2024
The virtuous loop that makes LLM apps better. Good product, drives User activity, which create Production logs, which feed into Datasets, which are tested by Evals, which improve the product.
3261
Matt Pocock @mattpocock.com · 20/11/2024
My AI prediction is that the delta between the good devs and the bad devs will massively increase. The best devs might even have their own custom workflows and 'teams' of AI agents. For the very best devs, this higher output will still mean very high quality code.
17922
Matt Pocock @mattpocock.com · 18/11/2024
Seems like everyone's number one question with building with AI is "how do you make it not shit?" The answer is evals. They're like unit tests, but for probabilistic systems. Here's an imaginary API to explain how they work:
const score = runEval({
  // 1. The prompts we'll test with
  data: [
    "Fish species in the Mediterranean",
    "Story of the first Moon landing",
    "Are Krakens real?",
  ],
  // 2. A function to generate outputs based
  // on our prompts
  task: async (topic) => {
    return generateArticle(topic);
  },
  // 3. The scorers we'll use to generate
  // the final score
  scorers: [
    // Checks if output is long enough
    length,
    // Uses an LLM to check if it's accurate
    factualAccuracy,
    // Uses an LLM to check writing style
    writingStyle,
  ],
});

// 4. A score between 0-100%
console.log(score);
3632
Matt Pocock @mattpocock.com · 15/11/2024
I think this baby book is coming on to me
0380
Matt Pocock @mattpocock.com · 13/11/2024
Aaaand you've gone too far
5761
Matt Pocock @mattpocock.com · 10/11/2024
"Think step-by-step" is going in all my prompts from now on.
13823
Matt Pocock @mattpocock.com · 08/11/2024
useRef still sucks in TypeScript
131402
Matt Pocock @mattpocock.com · 08/11/2024
Patch and Bandit hiding during our recent move
2411
Matt Pocock @mattpocock.com · 07/11/2024
The future is coming
5560
Matt Pocock @mattpocock.com · 04/11/2024
Reminder that this is a thing:
131388
Matt Pocock @mattpocock.com · 03/11/2024
Love a random search algo change. (dashed is last week, solid is this week)
070
Matt Pocock @mattpocock.com · 01/11/2024
A great way to constrain an LLM's inputs is to use XML tags (I know, so sexy) <links>{myLinks}</links> <content>{myBlogContent}</content> Really simple, effective way of passing inputs to your LLM - that can hopefully reduce hallucinations.
const system = `You are an assistant writing learning goals.

Given a title of an exercise, including the section and
course it belongs to, you will write a goal for the exercise.

Here are some previous examples:

<examples>
${exercises
  .map((exercise) => {
    return `
  <example>
    <course-title>${exercise.section.course.title}</course-title>
    <section-title>${exercise.section.title}</section-title>
    <exercise-title>${exercise.title}</exercise-title>
    <goal>${exercise.learningGoal}</goal>
  </example>
  `;
  })
  .join("\n")}
</examples>
`;
6590