Nula is a modern, very easy-to-use programming language. It features simple and readable syntax, performance close to C thanks to Zig, and the ability to run code in interpreted mode thanks to Python. The language also allows for easy translation of code from other languages (e.g., Python) into Nula.
# Simple Hello World in Nula
write("Hello, Nula!")
Get Started
@ File hello.nula - the simplest program
write("Hello, Nula!")
@ File variables types.nula - variables and types
@ Example of simple variables
let x = 10 @ integer
let y = 3.14 @ floating point number
let name = "nula" @ string
let flag = true @ logical value (boolean)
@ Operation example
let sum = x + y
let greeting = "Hi, " + name
write("x = " + x)
write("y = " + y)
write("sum = " + sum)
write(greeting)
@ File functions.nula - functions
@ Function declaration
func add(a, b) {
return a + b
}
func greet(name) {
write("Hello, " + name + "!")
}
@ Function calls
let result = add(5, 7)
write("5 + 7 = " + result)
greet("Michał")
@ File conditions.nula - conditional statements
let age = 20
if age >= 18 {
write("You are an adult.")
} else {
write("You're not of age yet.")
}
let number = 5
if number % 2 == 0 {
write("The number " + number + " is even.")
} else {
write("The number " + number + " is odd.")
}
@ File loops.nula - loops
@ While loop
let i = 0
while i < 5 {
write("Iteration: " + i)
i = i + 1
}
@ For loop
for j in [1, 2, 3, 4, 5] {
write("List item: " + j)
}