These pages describe the Verse programming language and its syntax. Spend time getting familiar with the language, then use these pages as reference.
If this is your first time using Verse, or if you're learning programming for the first time, make sure to check out Programming with Verse to help you get started. You'll also find a useful onboarding guide.
What Is Verse?
Verse is a programming language developed by Epic Games that you can use to create your own gameplay in Unreal Editor for Fortnite, including customizing your devices for Fortnite Creative.
Verse’s primary design goals:
Simple enough to learn as a first-time programmer.
General enough for writing any kind of code and data.
Productive in the context of building, iterating, and shipping a project in a team setting, and integrating code and content.
Statically verified to catch as many categories of runtime problems as possible at compile time.
Performant for writing real-time, open-world, multiplayer games.
Complete so that every feature of the language supports programmer abstraction over that feature.
Timeless — built for the needs of today, and for foreseeable future needs, without being rooted in the past artifacts of other languages.
The design goals above informed key features of the Verse programming language:
Strongly typed to minimize opportunities for uncaught errors in development or deployment and support static checking.
Multi-paradigm to use the best of functional programming, object-oriented programming, and imperative programming, such as being as deterministic as possible. One example of this is that data is immutable by default, and given the same code and data, results will always be exactly the same.
There is no distinction between statements and expressions. In Verse, everything is an expression, which means that everything has a result.
Failure is control flow. Instead of using true / false values to change the flow of your program (such as with decision points), Verse uses failable expressions, which produce a value if they succeed or don’t if they fail. Failable expressions can only be executed in failure contexts, such as if expressions.
The ability to do speculative execution within failure contexts, meaning you can try out actions without committing them. When an expression succeeds, the effects of the expression are committed, but if the expression fails, the effects of the expression are rolled back as though the expression never happened. This way, you can execute a series of actions that accumulate changes, but those actions will be undone if a failure occurs in the failure context.
**Concurrency at the language level so you don’t need to rely on system-level threads across multiple processors to perform actions simultaneously. You can author time flow the same as you do control flow by using built-in concurrency expressions in the language.
Epic Games is continuing to develop the Verse programming language and add more features. For Verse code that you write today, you can expect Verse to provide backward compatibility and continue to work with future updates to the language.
Explore the Language
Use the following pages as a reference for the Verse programming language.
Verse Language Version 1 Updates and Deprecations
Learn about the new updates and deprecations in Version 1 of the Verse Language.
Expressions
Everything in Verse is an expression and has a result. This page describes all the kinds of expressions in Verse.
Comments
A code comment explains something about the code. Comments are ignored when the program runs.
Constants and Variables
Variables and constants can store information, or values, that your program uses.
Common Types
Common types support the fundamental operations that most programs use.
Operators
Operators are special functions defined in the Verse programming language to perform actions such as the math operations for addition and multiplication.
Grouping
Group your Verse expressions to specify order of evaluation and improve readability.
Code Blocks
A code block is a group of expressions, and introduces a new scope for variables and constants.
Functions
A function is reusable code that performs an action and produces different outputs based on the input you provide.
Failure
Failure is a way to control the sequence in which a program performs actions, called the control flow.
Specifiers and Attributes
Learn about specifiers and attributes, and how to apply additional semantics and behavior to your Verse code.
Control Flow
Control flow is the order in which a computer executes instructions. Verse has a number of ways to change the control flow of your program.
Time Flow and Concurrency
You can author time flow the way you author control flow, by executing expressions simultaneously using built-in concurrency expressions in Verse.
Container Types
Store multiple values together by using a container type.
Composite Types
Create your own unique type from a composite type.
Working with Verse Types
Learn how to do more with types in Verse.
Modules and Paths
A Verse module is an atomic unit of code that can be redistributed and depended upon, and that you can import into your Verse file to use code definitions from other Verse files.