Skip to content

Quick Start

Radon can be used in two ways today:

  • Start the REPL with python radon.py
  • Run a file with python radon.py program.rn

Hello World

hello_world.rn
print("Hello, World!")

Run it from the repository root:

python radon.py hello_world.rn

REPL

Start the REPL:

python radon.py

Exit with exit() or by typing exit at the prompt.

A Slightly Larger Example

example.rn
import io

fun iseven(num) -> num % 2 == 0

class Greeter {
    fun __constructor__(name) {
        this.name = name
    }

    fun greet() {
        print("Hello, " + this.name)
    }
}

var name = io.Input.get_string("Name: ")
var greeter = Greeter(name)
greeter.greet()
print("Name length: " + str(name.length()))
print("Even test: " + str(iseven(42)))

This example shows the current language model in practice: imports, functions, classes, methods, built-ins, and values from the standard library.