Skip to content
0:00 / 0:00

#type-levelprogramming#scala3#givens

Type-Level Programming in Scala: A Hardcore Tic-Tac-Toe

Rock the JVM

27K subscribers • 59 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.

Advanced. Deep dive for people who know the field.

7.3K views3 years ago2 recommendations

Programming languagesComputer scienceScalaLanguage design and type systems

A step-by-step guide to implementing a Tic-Tac-Toe game entirely within the Scala 3 type system using givens.

Learn advanced Scala: rockthejvm.com/p/advanced-scala This video was inspired by a recent series of tweets about how TypeScript is soooo powerful that you can write programs at the type level... and Scala says: TypeScript, please. Then a blog post about a type-level tic-tac-toe in TypeScript which seemed to blow everyone's minds! Alright, that's enough. This video is a Tic-Tac-Toe in Scala, at the type level. You will learn how to program at the type level with givens, in a way that specifies constraints that the compiler should solve. This Scala type-level programming style is analogous to the programming language Prolog, which is a Turing-complete general constraint satisfaction solver. Follow Rock the JVM on: LinkedIn: linkedin.com/company/rockthejvm Twitter: twitter.com/rockthejvm Blog: blog.rockthejvm.com ------------------------------------------------------------------------- Home: rockthejvm.com -------------------------------------------------------------------------

Why it's here

2 people recommend this

What people say. Recommended as a mind-bending demonstration of Scala's powerful type-level programming capabilities.

u/danielciocirlanin r/scala • Recommends

Type-Level Programming in Scala: A Hardcore Tic-Tac-Toe

u/jivesishungryin r/scala • Recommends

Type-level tic tac toe using match types I saw Daniel's video on Rock the JVM about implementing tic tac toe at the type level and it occurred to me that with Scala 3's match types it should be possible to achieve a type-level tic tac toe without using implicit resolution. I spent some time on it last night and came up the following: https://gist.github.com/johnhungerford/906d5fac5c40212051358c2af739828e Are there any other ways you could do it? Here's the RJVM video for anyone who hasn't seen it: [video