Skip to content

Language Basics

This page introduces the syntax you will use most often as a beginner.

Semicolons are optional.

print("Hello")
print("Hello again");

Single-line comments:

# This is a comment
print("Visible output") # Inline comment

Multiline comments:

#--
This block is ignored.
#--
print("done")

Use var to define variables.

var age = 25
var height = 1.75
var name = "Alice"

Reassign values when needed:

var score = 10
score = 12

Optional type annotation syntax:

var title = "Numo" :: String

Both print styles are accepted:

print "Hello"
print("Hello")

Stop execution with panic:

panic("Something went wrong")

Current core expression support includes:

  • Numbers
  • Strings
  • Variables
  • Function calls
  • + operator
var a = 10
var b = 20
print(a + b)
print("Hello, " + "Numo")

Define functions with func.

func greet(name) {
print("Hello, " + name)
}
func ping() {
print("pong")
}
greet("Numo")
ping()

Current implementation supports zero or one parameter.

Import built-in modules like this:

get math from "internal:math"
print(math.pi())

Try a small mixed example:

get math from "internal:math"
get str from "internal:string"
get sys from "internal:system"
var name = "numo"
print("Language: " + str.upper(name))
print("PI: " + math.pi())
print("Platform: " + sys.platform())