Docs
VORKUTA5 Documentation
This page covers every part of VORKUTA5, from basic output and variables to classes, HTTP requests, and building web applications. Use the sidebar to jump to any topic.
24 topics
Getting Started
Installation
Choose your platform below to install VORKUTA5. Once installed, the vork5 command will be available in your terminal.
curl https://codeberg.org/VORKUTA5/VORKUTA5/raw/branch/dev/install.sh | bash
cd %LOCALAPPDATA%
git clone https://codeberg.org/VORKUTA5/VORKUTA5
cd VORKUTA5
make build
cd VORKUTA5\Interpreter
setx PATH "%PATH%;%LOCALAPPDATA%\VORKUTA5\Interpreter"
Usage
Run any .v5 file using the VORKUTA CLI:
vork <script.v5>
To check the installed version:
vork --version
Note: Only available on version 0.3.8 and up
Comments
Use
^to write a comment. The entire line is ignored by the interpreter. Comments must be on their own line.Semicolons
Use
;to separate statements from other ones. This allows for multiple lines to be compressed to 1.Original:
Compressed:
When using semicolons to separate statements, all colons on any command (like repeat) should be replaced with
;. Also keep in mind you can mix compressed and uncompressed lines but it is recommended to not.Output
Use
OUTto print a value. By default it does not add a newline.Add
&wrap(or&w) at the end to print with a newline:Use
WRAPon its own line to print a blank newline:Variables
Variables store text values. Declare and assign them with
VARIABLE(shorthand:v).You can reassign a variable at any time:
Variables, along with all other value types, can be defined automatically by simply not providing a type.
For the rest of the documentation, I will continue to use explicit type definition. Just know that it's NOT required.
String Interpolation
Embed a variable or expression inside a string using
{...}:Global Variables
To make variables accessible in every scope, prefix the declaration with
GLOBAL:String Literals
VORKUTA5 has two kinds of string literals: regular strings and raw strings.
Regular Strings
Written with double or single quotes. Supports
{...}interpolation.Raw Strings (backticks)
Written using backticks. Raw strings do not support interpolation. Useful for JSON, templates, and literal content.
String Methods
String methods are accessed with dot notation on any string variable.
.length()/.size().upper.lower.scrape.condense.find(sub)sub. Returns -1 if not found.center(size)All space not taken replaced with whitespace.
.ljust(distance).rjust(distance).remove(char).eval_exprCounters
Counters are integer variables. Explicitly define them with
COUNTER(shorthand:c).Or implicitly define them like so:
Quickly increment or decrement with
+/-:Floats
When explicitly defining variables, you cannot use
COUNTERfor floats. Instead useFLOAT.Compound Assignment
All assignment shorthands work on both variables and counters:
Counter Properties
.zero?"true"if the counter is 0.lengthOperators & Expressions
VORKUTA5 supports arithmetic, comparison, and logical operators anywhere an expression is expected.
Arithmetic
+-*/%Comparison
=!=<><=>=Logical
AND/&&OR/||NOT/!Taking User Input
Get user input with the
.takemethod. The string it's called on is the prompt shown to the user.TAKErequires the user to press Enter. For single-keystroke input without waiting for Enter, useKEYPRESS:Control Flow
Run a block of code only when a condition is true. The body is indented under the
IFline.IF / ELSE
ELSE IF
Combining Conditions
Using Boolean Properties
Ternary IF-ELSE statements
Ternary IF-ELSE statements are if else statements that return 1 of 2 values depending on if they are true or not. They are intended to be used directly in strings for simplicity. Example:
true ? condition : false !You can also nest them like so:
Loops
WHILE
Repeats a block as long as a condition is true.
Use
EXITto break out of a loop early:REPEAT
Repeats a block a fixed number of times.
Track the current iteration count with
AS:Increment by more than 1 with
+=:Lists
Lists are ordered collections of values, pretty much just arrays. Explicitly declare them with
LIST(shorthand:l).Access items by index (starts at 0), print the whole list, or get its length:
Assign to an index:
Empty List
Nested Lists
FOR Loop
Count iterations with
AS:List Methods
Called with dot notation on any list variable.
.length()/.size().empty?"true"if the list has no elements.append(val)valto the end.pop().find(val)val, or-1.sort("+")"-"for descending.reverse().join(sep)sep.slice(start, end)starttoend(inclusive), modifies list.static.contains(query)'true'or'false'if the list contains the queryTables
Tables are key-value stores identical to JSON dictionaries. Declare them with
TABLE(shorthand:t).Access values, assign to keys, and get the entry count:
Nested Tables
Tables with List Values
FOREACH loop
Count iterations with
AS:Table Methods
All table methods use dot notation.
.size()/.length().empty?"true"if the table has no entries.set(key, val)keytoval.add(key, val).set, add or update a key.drop(key)key.has(key)"true"ifkeyexists.keys.values.merge(other).rename(old, new).clear().copy.static.keys and .values
JSON Serialization
.staticbefore being able to be written to files. And JSON read from files comes back as a string and therefor must be turned dynamic with.dynamic()Sleep
Pause the script temporarily with
SLEEP timeExample
Functions (Programs)
Define functions with
PROGRAM. Explicitly call them withCALLor just use the function name without call. Return a value withRETURN.Basic Function
Function with Parameters
Inline Call in Expressions
Use
funcname(args)directly inside{...}to embed a call inline:Returning a List
Returning a Table
Built-in functions
VORKUTA5 has a few built-in functions for your convenience
.round()round(float)Classes
Classes define a reusable blueprint for object-oriented programming. Data stored in classes uses the class's own scope, not the global scope.
Methods in Classes
Classes can contain programs that act as methods. Programs inside classes cannot see class-level variables directly, you can use
RELATIVEfor shared scope:Libraries
Import libraries from the
stdlibsfolder withIMPORT. Template:Any library outside of the stdlibs folder can still be used by providing the entire directory instead of just the name.
After importing libraries, you can access their functions, variables, etc. using their alias. All custom methods however will be directly put into and accessible in the main script without needing the alias.
Libraries have completely separate scopes from the main script and the only way to access data from the library's script is via the alias. Libraries cannot use functions or get variables from the main script.
Example:
main.v5
example.v5
Custom Methods
In addition to built-in methods, you can define your own. Methods are similar to programs but attached to a data type.
selfholds the value being operated on;self.typeholds its type name.Accept multiple types by separating them with commas:
Methods with Parameters
Using Ruby in VORKUTA5
VORKUTA5 lets you embed and run Ruby code directly. The last expression in the Ruby block is the return value.
Passing Variables and Getting Output
RUBY ("Hello"). Ruby may take a moment on first run if it needs to initialize a fresh instance.Sending Commands to the System
Run system shell commands with
exec(). It's recommended to use a raw string (backticks) for the command to avoid symbol conflicts.Miscellaneous Commands
COLOR
Set the terminal text color. Available colors:
BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE, bold variants (BOLDRED, etc.), andRESET.DEBUG
Print each line before it executes, useful for tracing bugs.
SAVE
Save the current script state to a file.
FORCE_CLOSE
Immediately terminate the interpreter.
DISABLE
Disable a command so it does nothing when encountered.
!IGNOREWARNINGS
Suppress all runtime warnings and errors.
Interacting with Files
Before being able to interact with files, you need to import the file library.
IMPORT 'file.v5' AS File.Writing to Files
Reading Files
Deleting Files
Creating Web Applications
Defining Routes
Each route is defined with
SERVER. You must always specify the allowed HTTP methods.Request Object
request.methodGET,POST, …)request.pathrequest.bodyrequest.headerStarting the Server
Serving External Files
Return a filename string to serve an HTML file directly:
Multiple Routes
Full Example