Basic Syntax

In this tutorial, we'll cover the basic syntax of Cyrus Lang to get you started with writing your first programs.

Hello, World!

Let's start with the classic "Hello, World!" program:

func main() {
    println("Hello, World!")
}

This simple program demonstrates a few key elements of Cyrus Lang syntax:

  • Functions are declared using the func keyword.
  • The main() function is the entry point of the program.
  • Curly braces are used to define code blocks.
  • println() is a built-in function for printing to the console.

Variables

Cyrus Lang uses type inference to determine variable types. Here's how you declare variables:

let name = "Alice"
let age = 30
let pi = 3.14159

In the next section, we'll dive deeper into variables and types in Cyrus Lang.