Skip to main content

Why Luau?

Rive selected Luau (pronounced "Loo-ow") as its scripting language. Luau is a fast, small, safe, and gradually typed scripting language derived from Lua 5.1, primarily developed and maintained by Roblox.

Why Luau for a Design Tool?​

πŸš€ Performance and Size​

Real-time graphics demand efficiency. Luau's highly optimized Virtual Machine (VM) ensures scripts run quickly without causing frame drops, and its small footprint is crucial for web deployment.

πŸ”Œ Embeddability​

Luau is designed to be easily integrated into larger C++ applications, like the Rive Editor and its various runtimes (iOS, Android, Web, Flutter, etc.).

πŸ“ Gradual Typing (The Key Advantage)​

This is the cornerstone of the Rive scripting experience. While Luau can be written dynamically (like JavaScript or standard Lua), it supports a robust type system:

  • Robustness: Types help catch errors before the animation even runs. If you try to assign a Color where a number is expected, the editor flags it immediately.

  • Tooling: Rive generates Luau type definitions directly from its C++ engine APIsβ€”paths, shapes, transforms, artboards, view models, and more. This powers accurate autocomplete (IntelliSense).

🎯 Simple Semantics​

Based on Lua, the syntax is minimalist and accessible, making it easier for designers and new programmers to learn.

Luau vs Other Languages​

FeatureLuauJavaScriptPython
Type SystemGradual (optional)DynamicDynamic
PerformanceVery fastFastSlower
Bundle Size~200KBLargeN/A
Learning CurveEasyMediumEasy
Rive IntegrationNativeN/AN/A

Knowledge Check​

Q:What language is Luau derived from?
Q:Who primarily develops and maintains Luau?
Q:What does 'gradual typing' mean?

Ready to Start Scripting?​

Now that you understand WHY Rive uses Luau, it's time to write your first script. Choose the path that fits your experience:

🌱 New to Programming?

Start here: Your First Rive Script

We'll teach you programming concepts from scratch with clear explanations and interactive exercises. No prior experience needed.

πŸ’» Have JavaScript or After Effects Experience?

Start here: How Rive Scripts Work

Get up to speed fast with side-by-side comparisons to what you already know. Understand the Rive script structure through familiar concepts.

Both paths lead to the same place β€” Luau Fundamentals β€” so you can always reference the other track later if you want a different perspective!