Hello everyone!
Date: 18 January 2026
Language version: 0.1.0
In this tutorial, I will explain the basics of the
Cylium programming language.
First of all, you need to install the interpreter.
Basics
Create a file with the .cyl extension, for
example main.cyl.
Write the following code:
echo Hello, World!
exit 0
Run it:
$ ./cylium main.cyl
Hello, World!
As you can see, Cylium does not use
quotes for strings.
The echo operator is used to display anything
that can be converted to a string.
The statement exit 0 works similarly to
return 0 in C/C++.
The exit operator stops program execution, and
the number indicates the exit status:
exit 0- successful executionexit 1- program exited with an error
Variables and Input
Lets create a program that greets the user by name.
We need to:
1. Read user input
2. Store it in a variable
3. Display it
Variables are created using the var
keyword.
Constants (immutable variables) can be created using
const.
To display a variable inside a string, use
{}.
Example:
# Comments start with `#`
# `input` reads a line from standard input
var name = input
echo Hello, {name}!
exit 0
Run the program:
$ ./cylium main.cyl
Batman
Hello, Batman!
Memory management
Cylium is a manual memory management
language.
This means you must explicitly delete variables when they
are no longer needed.
You can do this using the delete
operator:
var name = Joker
delete name
A Little Bit of Math
Now lets read a number from the user and perform some calculations.
Cylium is a strongly typed
language.
This means each variable has a specific type, and type
conversion must be explicit.
Available types in Cylium:
- Vector
- String
- Boolean
- Number
- Float
When reading input:
var value = input
The variable value has the type
string.
To convert it to a number, use the as
operator:
var value = input
value as number
Now lets do some math:
var value = input
value as number
value += 5
echo value = {value * 2}
exit 0
Result:
$ ./cylium main.cyl
10
value = 30
You can also use:
- / for division
- % for modulo
- and other standard arithmetic operators
Goto
Now lets talk about one of the most fundamental parts of
the language - goto.
The goto operator is used to jump to a
specific line number or
label.
Jumping to a line
1| echo Hello, World!
2| goto 1
This creates an infinite loop:
$ ./cylium main.cyl
Hello, World!
Hello, World!
Hello, World!
...
Explanation:
- Line 1 prints the text
- Line 2 jumps back to line
1
- The program repeats forever
Using labels
Instead of line numbers, you can use
labels, which makes code clearer and easier
to maintain.
Labels are defined using a name followed by
:.
start:
echo Hello, World!
goto start
This code behaves exactly like the previous example but is more readable.
Cylium is not sensitive to spaces or tabs.
The code above could also be written as:
start:
echo Hello, World!
goto start
and it would work exactly the same way.
However, the first variant is more readable.
Goto as a loop
Using labels and goto, you can create
loop-like behavior.
var i = 0
loop:
echo {i}
i += 1
goto loop
This will print an increasing counter endlessly.
Why use goto?
In Cylium, goto is a core
control-flow mechanism.
It is used internally to implement:
- Loops
- Conditional jumps
- Functions
- State machines
While goto is often discouraged in other
languages, Cylium is designed around it, making its usage
explicit, predictable, and low-level.
Conditions
Lets solve an easy problem:
Two friends have bought X kilograms of candies.
Now they want to divide them equally.
Please help them! Display “YES” if they can, or “NO” if they cant.
What we need to do:
1. Read input into a variable
2. Convert the variable to a number
3. Check whether the number is odd or even
4. Display the answer
Full code:
var candies = input
candies as number
if candies % 2 == 0 then echo YES
else echo NO
exit 0
As you can see, conditions in Cylium work similarly to those in classic languages.
Now lets make the problem slightly harder:
Also display “?” if the friends dont have any candies.
var candies = input
candies as number
if candies <= 0 then echo ?
else if candies % 2 == 0 then echo YES
else echo NO
exit 0
After then (or else), you can
perform only two operations:
- echo
- the name of a label or a line number to jump to (the goto
keyword is omitted)
This means you cannot write:
if x < y then x += 1
Instead, you should write:
increase:
x += 1
if x < y then increase
Yet Another Problem
N friends came to a party, and everyone brought some candies.
How many kilograms of candies are there in total?
More formally, we need to calculate the sum of all input values.
Subtasks:
- Initialize a counter with zero
- Read N
- Create a loop from 0 to N
- Read a value on each iteration
- Add it to the counter
- Output the final result
Please try to solve this problem by yourself first!
Solution:
var n = input
n as number
var counter = 0
var i = 0
loop:
var candies = input
candies as number
counter += candies
i += 1
if i <= n then loop
echo {counter}
exit 0
For comparison, here is a solution in C++:
int main() {
int n;
cin >> n;
int counter = 0;
for (int i = 0, candies; i < n; i++) {
cin >> candies;
counter += candies;
}
cout << counter << '\n';
return 0;
}
Vectors
A vector is a heap-allocated dynamic array
that can store values of different types, be indexed, and
grow or shrink at runtime.
You can initialize a vector in three different ways:
# An empty vector
var nums = vector
# A vector with capacity for 5 elements
var nums = vector 5
# A vector with initial values
var nums = 1, 2, 3, 4, 5
You can work with indexes:
nums[3] = 5
nums[3] += 4
You can also push new elements to the end of a vector:
nums push 6
Or remove an element by index:
nums remove 3
Final Thoughts
Cylium is a minimalistic language built around clarity,
control, and explicit behavior.
It takes ideas from low-level languages like C and Rust,
while keeping the syntax clean and easy to follow.
The goal of Cylium is simplicity without hiding important details - especially when it comes to control flow and memory.
Thank you for your attention.
Now its your turn.
Try implementing the Fibonacci
sequence in Cylium and explore how far you can go with
just variables, conditions, and goto.