Luau for Kotlin Developers
Transfer Kotlin null safety, collections and classes to Luau tables, closures and typed signatures. Practice runtime validation, relative modules and metatable objects, build a stock ledger and port two Kotlin programs.
Kotlin and Luau side by side
The same program in Kotlin and in Luau, from the lessons of this course.
Print and Comment
Kotlin string templates assemble text before println prints it. Luau print can take several values but inserts tabs between them; use .. to assemble one exact string. Luau chunks run directly without a main function, and line comments use -- rather than…
Kotlin1 2fun main(){3println("Hi"+", Ada")4}Luau1local name = "Ada"2print(`Hi, {name}`)Missing Fields and Optionals
A Kotlin map with nullable values can retain a key mapped to null, and containsKey distinguishes presence. Luau nil removes a table association. A number? annotation permits nil but cannot retain a nil-valued key. Use a tagged state record for…
Kotlin1 2fun main(){3val record=mapOf<String,Int?>("x" to null)4println(record.containsKey("x"))5}Luau1local d = {x = nil}2print(d.x == nil)Inclusive Numeric Loops
Kotlin inclusive ranges and exclusive ranges express different final values, and downTo supplies descending progression. Luau numeric for uses an inclusive bound and optional step. Translate the values actually visited and preserve empty-range cases rather…
Kotlin1 2fun main(){3var total=04for(i in 1 until 4) total+=i5println(total)6}Luau1local total = 02for i = 1, 3 do total = total + i end3print(total)Functions and Returns
Kotlin parameters have declared types and receive values, including references to objects; parameters cannot be rebound as ordinary mutable locals. Luau scalar parameters may be rebound locally and table fields may mutate shared state. Typed signatures do not…
Kotlin1fun twice(n:Int)=n*22fun main(){3println(twice(4))4}Luau1local function twice(x: number): number return x * 2 end2print(twice(4))Lists as Dense Tables
Kotlin separates read-only and mutable collection interfaces, but a read-only view does not necessarily mean immutable underlying storage. Luau dense tables use one-based keys and table.remove shifts later elements. Assigning nil creates a hole. A type…
Kotlin1 2fun main(){3val values=mutableListOf("a","b","c")4values.removeAt(1)5println(values.joinToString(","))6}Luau1local a = {"a", "b", "c"}2table.remove(a, 2)3print(table.concat(a, ","))Sorting and Comparators
Kotlin comparators return negative, zero or positive integers, while sort and sorted distinguish mutation from creating a result. Luau table.sort mutates and expects a Boolean strict-order predicate. Returning a number fails because zero is truthy. Keep the…
Kotlin1 2fun main(){3val values=mutableListOf(3,1,2)4values.sortWith(compareBy {it})5println(values[0])6}Luau1local a={3,1,2}2table.sort(a)3print(a[1])
Syllabus
10 chapters48 lessons1 project48 challenges99 quiz questionsFirst Luau Programs
6 lessonsValues and Decisions
5 lessonsIteration and Flow
5 lessonsFunctions and Closures
5 lessonsTables as Collections
5 lessonsOrdering, Modules and Errors
5 lessonsObjects and Owned State
5 lessonsComposition and Object Lookup
6 lessonsProject: Stock Ledger
4 lessonsFinal Source Ports
2 lessonsFrequently asked questions
Who is Luau for Kotlin Developers for?
For people who already write Kotlin and want to learn Luau. Each lesson starts from Kotlin you know and shows how Luau does the same thing, so you skip the beginner basics.
Do I need to know Luau already?
No. The course starts with your first Luau program. You need Kotlin basics: variables, conditions, loops, functions and collections.
How many lessons does Luau for Kotlin Developers have?
Luau for Kotlin Developers contains 48 interactive lessons you can complete at your own pace.
What does Luau for Kotlin Developers cover?
The course is organized into chapters covering: First Luau Programs, Values and Decisions, Iteration and Flow, Functions and Closures, and more.
Is Luau for Kotlin Developers free?
Yes. Every course on Coddy is free to start. You can complete lessons in your browser without any downloads or signup.