What is Wren?
Wren is a small, fast, class-based concurrent scripting language. Talon uses Wren as its primary scripting language for game development. Learn more at wren.io.Basic Syntax
Wren is designed to be familiar if you’ve used languages like JavaScript, Lua, or Python. Here are the key concepts:Variables and Constants
Classes
Wren is class-based. Here’s a simple class definition:Classes with Constructors
More complex classes can have constructors and instance variables:Instance variables in Wren are prefixed with an underscore (
_). Getters are defined using the shorthand name { _name } syntax.Functions and Closures
Wren supports first-class functions:Import System
Talon provides several built-in modules that you can import:Importing Built-in Modules
Importing Local Modules
You can import your own Wren files using relative paths:When importing local modules, use the
./ prefix for files in the same directory. You can export classes, variables, and constants from your modules.Control Flow
Conditionals
Loops
Data Structures
Lists
Wren has built-in List support:Working with Foreign Classes
Talon provides Raylib bindings as foreign classes:Learn More
For a complete guide to the Wren language, visit:Wren Language Documentation
Official Wren documentation with detailed language reference and examples
Next Steps
Game Loop
Learn about Talon’s game loop structure
Project Structure
Organize your Wren files and modules