Verse (programming language)

Last updated
Verse
Verse Programming Language Logo.jpeg
Paradigm Object-oriented
Designed by Simon Peyton Jones, Tim Sweeney, Lennart Augustsson, Guy Steele, Olin Shivers, Ranjit Jhala, Koen Claessen, Joachim Breitner
Developer Epic Games
First appeared2023;1 year ago (2023)
Typing discipline Strong
License Proprietary
Filename extensions .verse
Website dev.epicgames.com/documentation/en-us/uefn/verse-language-reference

Verse is a static typed object-oriented programming language created by Epic Games. It was released alongside UEFN in March 2023 and was authored by a team of well-known programmers led by Simon Peyton Jones, and Epic Games CEO Tim Sweeney. Verse is designed to interact with Fortnite Creative's existing ‍​devices system. As of June 2024, UEFN remains the only way to interpret, parse, compile or run Verse code; plans to implement the language into the release of Unreal Engine 6 have been discussed. [1]

Contents

Features

Modules and importing

Verse supports modular programming, allowing developers to import specific modules required for their scripts. Commonly used modules include the API digests that are generated every time a project containing verse is opened. There is an API digest to access and interact with Fortnite objects, Verse objects, and Unreal Engine objects. Developers can also create their own modules and import them into scripts if needed.

Classes and objects

Verse employs a class-based object-oriented programming model. Developers can define classes to represent various game entities and behaviors.

For example:

hello_world_device := class(creative_device):     OnBegin<override>()<suspends>:void=         Print("Hello, world!")         Print("2 + 2 = {2 + 2}")

The above code defines a new class inheriting from `creative_device` and prints the traditional "Hello, world" message. All classes inherited from a `creative_device' can be placed into the engine's spatial environment when compiled. The `creative_device` class is necessary to interact with the pre-existing Fortnite Creative toolset.

Functions and methods

Verse allows defining functions within classes. These can perform various operations, such as mathematical calculations, game logic, and more. The example below is a method to determine if a character is looking at a specific location.

IsLookingAtLocation(Character:fort_character, LocationToCheck: vector3, Threshold: float):logic

Event handling

The language supports event-driven programming, where events like EliminatedEvent and PlayerAddedEvent can trigger specified functions. Events can also be subscribed to and listened for.

Mathematical and spatial operations

Verse supports various mathematical functions necessary for game development, such as calculating magnitudes, normalizing vectors, and converting rotations to direction vectors. The spatial math module provides classes and functions for vector and rotational math, essential for game development tasks like positioning and movement. Cos , Normalize , Distance , ArcTan , and Lerp are a few of the functions are available for mathematical operations. [2] [3]

Lambda calculus

Verse code shares several similarities with lambda calculus, particularly in how it handles functions and data. In lambda calculus, functions are first-class citizens, meaning they can be passed as arguments to other functions, returned as values from other functions, and assigned to variables; while in Verse functions can be passed around and manipulated similarly, showcasing the functional programming paradigm. Examples include methods like Normalize(v1:vector3) and DrawDebugLine(LineStart: vector3, LineEnd: vector3). Verse supports lambda expressions and anonymous functions, allowing for inline function definitions, similar to how lambda functions are used in languages like Python or JavaScript. Verse also allows for composing functions by chaining method calls and passing functions as parameters. The declarative style used in lambda calculus is also a prominent feature of Verse for defining data transformations and computations rather than an imperative control flow model. This is seen in functions like Normalize and DrawDebugLine which are defined declaratively. [4] [3]

Future plans

Epic Games has described Verse as the programming language for the metaverse and has factored mass scalability into its development. Until the proposed convergence with Unreal Engine, it is yet to be seen how Verse will behave interacting with various systems and processes outside of the Fortnite ecosystem.

Related Research Articles

<span class="mw-page-title-main">Common Lisp</span> Programming language standard

Common Lisp (CL) is a dialect of the Lisp programming language, published in American National Standards Institute (ANSI) standard document ANSI INCITS 226-1994 (S2018). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived from the ANSI Common Lisp standard.

In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.

<span class="mw-page-title-main">MATLAB</span> Numerical computing environment and programming language

MATLAB is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.

<span class="mw-page-title-main">Scheme (programming language)</span> Dialect of Lisp

Scheme is a dialect of the Lisp family of programming languages. Scheme was created during the 1970s at the MIT Computer Science and Artificial Intelligence Laboratory and released by its developers, Guy L. Steele and Gerald Jay Sussman, via a series of memos now known as the Lambda Papers. It was the first dialect of Lisp to choose lexical scope and the first to require implementations to perform tail-call optimization, giving stronger support for functional programming and associated techniques such as recursive algorithms. It was also one of the first programming languages to support first-class continuations. It had a significant influence on the effort that led to the development of Common Lisp.

<span class="mw-page-title-main">Lua (programming language)</span> Lightweight programming language

Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications.

In programming languages, a closure, also lexical closure or function closure, is a technique for implementing lexically scoped name binding in a language with first-class functions. Operationally, a closure is a record storing a function together with an environment. The environment is a mapping associating each free variable of the function with the value or reference to which the name was bound when the closure was created. Unlike a plain function, a closure allows the function to access those captured variables through the closure's copies of their values or references, even when the function is invoked outside their scope.

In programming language theory and proof theory, the Curry–Howard correspondence is the direct relationship between computer programs and mathematical proofs.

ABAP is a high-level programming language created by the German software company SAP SE. It is currently positioned, alongside Java, as the language for programming the SAP NetWeaver Application Server, which is part of the SAP NetWeaver platform for building business applications.

A typed lambda calculus is a typed formalism that uses the lambda-symbol to denote anonymous function abstraction. In this context, types are usually objects of a syntactic nature that are assigned to lambda terms; the exact nature of a type depends on the calculus considered. From a certain point of view, typed lambda calculi can be seen as refinements of the untyped lambda calculus, but from another point of view, they can also be considered the more fundamental theory and untyped lambda calculus a special case with only one type.

<span class="mw-page-title-main">Unreal Engine</span> Video game engine developed by Epic Games

Unreal Engine (UE) is a series of 3D computer graphics and game engines developed by Epic Games, first showcased in the 1998 first-person shooter video game Unreal. Initially developed for PC first-person shooters, it has since been used in a variety of genres of games and has been adopted by other industries, most notably the film and television industry. Unreal Engine is written in C++ and features a high degree of portability, supporting a wide range of desktop, mobile, console, and virtual reality platforms.

<span class="mw-page-title-main">ActionScript</span> Object-oriented programming language created for the Flash multimedia platform

ActionScript is an object-oriented programming language originally developed by Macromedia Inc.. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk. ActionScript code is usually converted to byte-code format by a compiler.

<span class="mw-page-title-main">Tim Sweeney</span> American video game developer (born 1970)

Timothy Dean Sweeney is an American video game programmer and businessman. He is the founder and CEO of Epic Games, and the creator of Unreal Engine, a game development platform.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

In logic, a logical framework provides a means to define a logic as a signature in a higher-order type theory in such a way that provability of a formula in the original logic reduces to a type inhabitation problem in the framework type theory. This approach has been used successfully for (interactive) automated theorem proving. The first logical framework was Automath; however, the name of the idea comes from the more widely known Edinburgh Logical Framework, LF. Several more recent proof tools like Isabelle are based on this idea. Unlike a direct embedding, the logical framework approach allows many logics to be embedded in the same type system.

In computer programming, an entry point is the place in a program where the execution of a program begins, and where the program has access to command line arguments.

In computer programming, an anonymous function is a function definition that is not bound to an identifier. Anonymous functions are often arguments being passed to higher-order functions or used for constructing the result of a higher-order function that needs to return a function. If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function. Anonymous functions are ubiquitous in functional programming languages and other languages with first-class functions, where they fulfil the same role for the function type as literals do for other data types.

Logtalk is an object-oriented logic programming language that extends and leverages the Prolog language with a feature set suitable for programming in the large. It provides support for encapsulation and data hiding, separation of concerns and enhanced code reuse. Logtalk uses standard Prolog syntax with the addition of a few operators and directives.

Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required.

Smart Pascal is an Object Pascal programming language that is derived from Delphi Web Script and is adapted for Smart Mobile Studio, commercial development JavaScript machine code.

Unreal Editor for Fortnite, or UEFN is a specialized version of Unreal Engine released in 2023 tailored for creating and editing UGC content within Fortnite, a popular online video game developed by Epic Games. UEFN integrates the functionalities of Unreal Engine with aspects of Fortnite, allowing for a more comprehensive experience than it's predecessor Fortnite Creative.

References

  1. "VerseMetaVerse/UnrealVerse". Github. Retrieved 6 June 2024.
  2. "Beyond functional programming: a taste of Verse. Simon Peyton Jones & Tim Sweeney | Lambda Days 2023". YouTube. Code Sync. Jun 26, 2023.
  3. 1 2 JONES, SIMON PEYTON; SWEENEY, TIM; STEELE, GUY; SHIVERS, OLIN; JHALA, RANJIT; CLAESSEN, KOEN; BREITNER, JOACHIM; AUGUSTSSON, LENNART (2023). "The Verse Calculus A Core Calculus for Functional Logic Programming" (PDF).
  4. "Unofficial Verse API". FNCwiki.