Тёмный

Nathan Holland- GADTs and You; Writing Safer Code Using GADTs- λC 2019 

LambdaConf
Подписаться 7 тыс.
Просмотров 2 тыс.
50% 1

You may have heard about the high degree of safety you can achieve by using new and experimental, dependently-typed programming languages, but did you know that you can get some of those benefits in a programming language you already know and use? Enter the GADT: your gateway to writing safer code today.
Generalized Algebraic Data Types (GADTs) allow programmers to provide extra information to their programming language’s type system based on values of types. Using this, programmers can write code that forces the compiler to prove certain facts about the code being compiled before type checking terminates. While GADTs are significantly more limited than dependently-typed programming languages, there is still a class of bugs we can protect ourselves from by using GADTs, bugs that would ordinarily be accepted by the compiler. We will review a variety of patterns with GADTs, including encoding Peano numbers, restricting sizes of data structures, using typed heterogeneous data structures, and restricting certain states of values at compile time. We will also review practical applications of these techniques to catch bugs, including an example or two of how my company is using GADTs to better validate our cryptocurrency protocol. The talk will focus on the OCaml programming language, but these techniques apply to any language with support for GADTs.

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
Редакция. News: 136-я неделя
45:09
Просмотров 1,2 млн
Почему?
00:22
Просмотров 196 тыс.
Andreas Garnæs - Type-Safe GraphQL Servers with GADTs
39:57
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
GADTs in Dotty - Aleksander Boruch-Gruszecki
30:44
Просмотров 3,1 тыс.
Microservices are Technical Debt
31:59
Просмотров 349 тыс.
Do more with your types: GADTs and LiquidHaskell
1:30:21
Просмотров 3,2 тыс.
Редакция. News: 136-я неделя
45:09
Просмотров 1,2 млн