Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verse Sandbox

A no-Unreal-Editor, no-UEFN sandbox for learning and experimenting with Verse. Write small Verse packages, run them from the command line (or VS Code), see the output — like a scratch REPL for the language.

./run-verse.ps1 sandbox\HelloVerse\HelloVerse.verse Main          # -> Hello, world!
./run-verse.ps1 sandbox\InventoryExample\InventoryExample.verse RunExample

Windows only (PowerShell + MSVC + the UE Windows build).


What this is (and what it is not)

There is no standalone Verse VM to extract — the VM is welded into Unreal Engine. Instead this sandbox drives a console program Epic ships in engine source, VerseCLR (the real Verse compiler + VM in one executable, built with no editor/UI). We build the VerseCLRNoAutoRTFM variant and wrap it with scripts + example packages + VS Code wiring.

This repo does NOT contain any Epic binaries or engine content. The Unreal Engine EULA does not permit redistributing engine tools/content, so you build the runner yourself from your own licensed UE source tree. The repo is just the scaffolding; setup.ps1 compiles the runner and wires it up.

Prerequisites

  1. Epic Games GitHub access — link your Epic and GitHub accounts and accept the invite: https://www.unrealengine.com/ue-on-github
  2. A UE 6.0 source tree (branch ue6-main of EpicGames/UnrealEngine). Tested at commit 22a975cc7ac4a3ab6b4ca308c143714c3fa5e2dc. See below.
  3. Visual Studio 2022 with the Game development with C++ (or Desktop C++) workload. .NET comes bundled with UE.
  4. Disk + bandwidth: a UE source tree + dependencies is tens of GB.

Quickstart

# 1. Get a UE 6.0 source tree (skip if you already have one) — see "Getting UE 6.0".
#    git clone --branch ue6-main https://github.com/EpicGames/UnrealEngine.git D:\UnrealEngine-UE6
#    cd D:\UnrealEngine-UE6 ; ./Setup.bat

# 2. Clone this repo and build + wire the runner (one time):
git clone <your-fork-url> verse-sandbox
cd verse-sandbox
./setup.ps1 -EngineRoot D:\UnrealEngine-UE6          # add -MaxParallelActions 4 if you have RAM headroom

# 3. Run Verse:
./run-verse.ps1 sandbox\HelloVerse\HelloVerse.verse Main

setup.ps1 builds only the one program target (VerseCLRNoAutoRTFM) — it does not build the editor. It writes the engine location to a local, git-ignored .engine-root file used by run-verse.ps1.

Getting UE 6.0 source

You need a source tree, not a launcher/UEFN install. Either:

  • Fresh clone (simplest):
    git clone --branch ue6-main https://github.com/EpicGames/UnrealEngine.git D:\UnrealEngine-UE6
    cd D:\UnrealEngine-UE6
    ./Setup.bat                 # downloads ~30 GB of dependencies (incl. toolchains)
  • Worktree off an existing UE checkout (reuses git objects):
    git -C <existing-UE-repo> fetch upstream 22a975cc7ac4a3ab6b4ca308c143714c3fa5e2dc
    git -C <existing-UE-repo> worktree add D:\UnrealEngine-UE6 22a975cc7ac4a3ab6b4ca308c143714c3fa5e2dc
    cd D:\UnrealEngine-UE6 ; ./Setup.bat

You do not need to run GenerateProjectFiles or build the editor — setup.ps1 builds just the runner via UnrealBuildTool.

Usage

# run-verse.ps1 <package-or-.verse> <function> [extra VerseCLR flags...]
./run-verse.ps1 sandbox\HelloVerse\HelloVerse.verse Main
./run-verse.ps1 sandbox\InventoryExample\InventoryExample.verse RunExample

A program is a tiny package: a folder with a .vproject + one or more .verse files. Passing a .verse file auto-finds its sibling .vproject.

From VS Code: open this folder, open a .verse, press Ctrl+Shift+B — it prompts for the function (default Main) and prints output in the terminal.

Interactive REPL:

& "$(Get-Content .engine-root)\Engine\Binaries\Win64\VerseCLRNoAutoRTFM.exe" --interactive

Useful flags (after the target): --list (list runnable functions) · --print-vst / --print-disassembly · --args=1,2.0,\"foo\" · --log=verbose.

Learn Verse

  • Take the tour: ./run-verse.ps1 sandbox\Tour\Tour.verse RunTour — one runnable file touring values, failure (<decides>), control flow, classes/structs/enums, options, and collections.
  • docs/getting-started.md — fresh-clone-to-first-script walkthrough.
  • docs/verse-cheatsheet.md — quick syntax reference + gotchas.
  • The Verse book — the full language.

Writing your own script

Copy sandbox/HelloVerse to a new folder, rename the .vproject and set its name / versePath, then edit the .verse. Print comes from using { /Verse.org/VerseCLR }.

Verse-version gotchas (hit porting the book's example)

  • Class-scope constants need an explicit type: X:int = 100, not X := 100.
  • A class can't be both <unique> and <persistable>.
  • A function called from transactional code (incl. for-filter predicates) must itself be <transacts>; a bare <decides> is no_rollback.
  • Functions can't be declared inside another function's body — use top level.
  • Top-level --target functions should not be <suspends> (the runner crashes spawning a coroutine for them); use <transacts>/plain.

How it works / why this variant

Variant Compiler VM
VerseCLRVM EpicClang (AutoRTFM) new VerseVM fails to build Chaos under Clang in this commit + very memory-heavy
VerseCLRNoAutoRTFM MSVC BPVM builds cleanly, low memory — what we use

The new-VM build uses Epic's AutoRTFM Clang, which (a) hits a Chaos compile bug in this commit and (b) reserves enormous virtual memory. VerseCLRNoAutoRTFM builds with plain MSVC and runs the established BPVM. For learning the language and running the book's examples, behavior is identical.

Layout

Path What
setup.ps1 one-time: build the runner, wire .engine-root
run-verse.ps1 run a package/target through the runner
sandbox/HelloVerse/ minimal Print("Hello, world!") package
sandbox/Tour/ guided one-file tour of the language (RunTour)
sandbox/InventoryExample/ the Verse book's inventory example, runnable
.vscode/ Ctrl+Shift+B run task + recommended extensions
docs/getting-started.md newcomer walkthrough
docs/verse-cheatsheet.md syntax quick reference + gotchas

License

Sandbox scaffolding: MIT (see LICENSE). Unreal Engine, the Verse toolchain, and any Epic binaries/content are covered by the Unreal Engine EULA and are not included or redistributed here.

About

A standalone, no-UEFN sandbox for learning Verse — write scripts and run them via Epic's VerseCLR (no editor).

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages