Peter Kröner

Where we're going we don't need JavaScript - Programming with Type Annotations

Your type system is a programming language. Learn to encode business logic directly into your types and make entire classes of bugs impossible at runtime.

Where we're going we don't need JavaScript - Programming with Type Annotations
#1about 2 minutes

Viewing TypeScript type annotations as a language

TypeScript's type system can be treated as its own functional, set-based programming language.

#2about 2 minutes

Mapping JavaScript syntax to TypeScript type constructs

Learn how JavaScript concepts like variables, functions, and objects correspond to type aliases, generics, and object types.

#3about 2 minutes

Understanding the set-based nature of TypeScript types

All types are fundamentally sets or unions, which simplifies operations and eliminates the need for explicit loops.

#4about 2 minutes

Building a type-level function to filter union types

A practical example demonstrates how to create a generic type that uses conditionals to filter null from a union.

#5about 3 minutes

The motivation for programming with type annotations

Using type-level programming allows you to abstract and enforce core business logic, similar to how high-level languages abstract machine code.

#6about 2 minutes

Deriving concrete types from abstract business rules

Instead of writing types manually, define core business rules as abstract types and then derive all concrete implementation types from them.

#7about 4 minutes

A practical example of a type-safe message bus

The challenge of building a type-safe message bus for a browser extension is introduced as a use case for type-level programming.

#8about 5 minutes

Using generics and keyof to enforce message contracts

The `send` and `on` methods are made type-safe by using generics, the `keyof` operator, and indexed access types derived from a central payload map.

#9about 3 minutes

The benefits of deriving types from first principles

Deriving types from a central source of truth ensures consistency and provides type-level automation across your entire project.

#10about 4 minutes

Q&A on performance, interfaces, and advanced learning

The speaker answers audience questions about runtime performance, the difference between `type` and `interface`, and how to learn advanced TypeScript patterns.

Related jobs
Jobs that call for the skills explored in this talk.

Software Engineer

tree-IT GmbH
Bad Neustadt an der Saale, Germany

Intermediate
Senior

Angular Developer

Picnic Technologies B.V.
Amsterdam, Netherlands

Intermediate
Senior

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
JavaScript is the backbone of web development, powering everything from small websites to large-scale enterprise applications. However, as projects grow in complexity, maintaining JavaScript code can become increasingly difficult. This is where TypeS...
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
DC
Daniel Cranney
Dev Digest 159: AI Pipelines, 10x Faster TypeScript, How to Interview
Inside last week’s Dev Digest 159 . 🤖 How to use LLMs to help you write code ⚡ How much electricity does AI need? 🔒 Is your API secure? Learn all about hardening it… 🟦 TypeScript switches to go and gets 10 times faster 🖼️ An image cropper in your ap...
Dev Digest 159: AI Pipelines, 10x Faster TypeScript, How to Interview
TL
Thomas Limbüchler
What is TypeScript?
Since Angular 2 at the latest, TypeScript has been known to many. But what exactly can you do with it, and is it worth changing?Anyone who has worked with programming languages ​​such as Java or C# before will have noticed that JavaScript allows a su...
What is TypeScript?
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos

From learning to earning

Jobs that call for the skills explored in this talk.

Typescript Developer

Typescript Developer

Dabster
Charing Cross, United Kingdom

Java
Docker
JavaScript
TypeScript
Microservices
+1