Live Coding Kotlin/Native Snake
summary
Live codes a playable Snake written in Kotlin/Native that compiles to a terminal binary using Gradle, pregenerated POSIX bindings and ncurses for UI; implements unit tests, immutable game state (snake, apples, score), and apple spawning, and shows memory management with memScoped/defer and explains Kotlin/Native’s reference counting. The result is a working terminal game (~1.3 MB binary) that moves and grows correctly. Caveats: Beta tooling, slow compilation and rough IDE support, but native interop and runtime behavior demonstrably work.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 0:30What is Kotlin Native
- 4:52Why Kotlin Native
- 5:45Live Coding
- 8:48Snake
- 13:15Tests
- 14:15Screen
- 15:03Window
- 16:08Running from normal terminal
- 16:49Print to screen
- 18:32Bridge code
- 20:28Input
- 20:58Dont Move
- 21:16Move
- 23:04HalfDelay
- 24:12Snake Changes Direction
- 27:00Snake Direction
- 27:54Memory Management
- 32:11Game refactoring
- 34:15Game is over
- 35:57Apples
- 37:37Draw function
- 38:20Snake function
- 40:09Snake growth
related talks
44mLive Coding Kotlin - Native Snake
41mLive Coding Kotlin/Native Snake
47mSnake in 10 Lines: Learning More by Coding Less
46mMaking Noise with Kotlin Native
54mKotlin/Native: Answers You Won't Find on the Internet
44mDeep Dive into Kotlin/Native
43mThe Triumphs and Tribulations of Kotlin-Native in Practice
52mKEYNOTE: Kotlin/Native – Embracing existing ecosystems
