Source-first โ€ข Python-powered

The Radon Programming Language

Write clean, expressive code with built-in REPL, script runner, standard library modules, classes, error handling, and safe Python interop โ€” all from source.

โšก REPL ๐Ÿ“„ Script runner ๐Ÿ Python interop ๐Ÿ“ฆ Standard library
  • Run the REPL with python radon.py
  • Execute files with python radon.py program.rn
  • Use modules, classes, arrays, hash maps, and Python interop
Rn
v0.0.1a2

Quick start

Get running in under a minute

Clone the repository and run directly from source. No build step required โ€” just Python 3.12+ and you're ready to go.

git clone https://github.com/radon-project/radon.git
cd radon
python radon.py                      # Start REPL
python radon.py examples/simple.rn   # Run a file

Language tour

Explore the syntax

Familiar constructs, clean design. See how Radon handles classes, loops, error handling, and more.

import io

class Animal {
    fun __constructor__(name, sound) {
        this.name = name
        this.sound = sound
    }

    fun speak() {
        print(this.name + " says " + this.sound)
    }

    # Operator overloading
    fun __add__(other) {
        return Animal(this.name + "&" + other.name, "...")
    }
}

var dog = Animal("Dog", "Woof")
var cat = Animal("Cat", "Meow")
dog.speak()
cat.speak()

var both = dog + cat
both.speak()  # Dog&Cat says ...
# Counting with a for loop
for i = 0 to 5 {
    print(i)
}

# While loop with a condition
var count = 0
while count < 3 {
    print("tick: " + str(count))
    count = count + 1
}

# Loop with step
for i = 0 to 10 step 2 {
    print(i)  # 0, 2, 4, 6, 8
}
fun divide(a, b) {
    if b == 0 {
        raise Exception("Division by zero")
    }
    return a / b
}

# Wrap risky calls in try/catch
try {
    print(divide(10, 2))   # 5
    print(divide(5, 0))    # raises
} catch err {
    print("Caught: " + str(err))
}
# Arrays
var nums = [1, 2, 3, 4, 5]
append(nums, 6)
print(nums)          # [1, 2, 3, 4, 5, 6]
print(nums[0])       # 1

# Slicing
print(nums[1:4])     # [2, 3, 4]

# Hash maps
var config = {
    "host": "localhost",
    "port": 8080
}
print(config["host"])   # localhost
# Import and use any Python module
var os_mod = pyapi("import os; os")
var cwd = pyapi("os.getcwd()")
print(cwd)

# Python's math library
var math = pyapi("import math; math")
print(pyapi("math.sqrt(144)"))   # 12.0

# Date and time
var dt = pyapi("import datetime; datetime")
print(pyapi("str(datetime.date.today())"))
โšก

REPL & scripting

Run code your way

Launch an interactive REPL with python radon.py or run any .rn file directly. No build step, no config.

๐Ÿ—๏ธ

OOP

Classes and objects

Define classes with __constructor__, instance methods, and this โ€” operator overloading supported out of the box.

๐Ÿ›ก๏ธ

Error handling

Try, catch, raise

Structured exception handling with try/catch/raise lets you write robust programs without crashing the runtime.

๐Ÿ”ง

Built-ins

Rich built-in functions

Over 30 built-in helpers โ€” str_len, is_num, append, range, type and more โ€” available with no imports.

๐Ÿ“ฆ

Modules

Import system

Use import module or from module import name. Standard library modules are plain .rn files you can read and modify.

๐Ÿ”’

Security

Sandboxed Python bridge

Access any Python library via pyapi(). The runtime can prompt the user before allowing Python, disk, or network access.

Standard library

Modules currently shipped in the repo

argparserCLI argument parsing
arrayArray utilities & helpers
colorlibTerminal colour output
ioTyped input helpers
mathMathematical functions
osOS & filesystem access
radiationRadon meta-utilities
stringString manipulation
systemProcess & env control
universeGlobal constants & helpers
winlibWindows-specific APIs

All modules are plain .rn files in the stdlib/ folder โ€” readable, forkable, and easy to extend. See the standard library docs for full API references.