Language Documentation

RuLang Programming Language

A dynamic, multi-paradigm interpreted language. Designed for readability and developer productivity, featuring clean indentation-based syntax and first-class functional and object-oriented paradigms.

Clean Syntax

Eliminates syntactic clutter with indentation-based scoping and intuitive block structuring for highly readable code.

Multi-Paradigm

Seamlessly mix object-oriented classes with multiple inheritance alongside functional lambdas and closures.

Rich Data Structures

Built-in support for lists, dictionaries, and tuples, complete with advanced slicing and indexing capabilities.

main.ru
# RuLang Sample Script
import math as m

// Object-Oriented Programming
class FibonacciCalculator:
    def calculate(n):
        if n <= 1:
            return n
        return self.calculate(n - 1) + self.calculate(n - 2)

// Functions & Lambdas
let format_output = (result) => "Result: {result}"

// Control Flow & Instantiation
let calc = FibonacciCalculator()
for i in [1, 2, 3, 4, 5]:
    let val = calc.calculate(i)
    print(format_output(val))

Language Guide

Specification // Basics & Types

RuLang uses indentation-based scoping; code blocks are designated by a colon (:) followed by an indented block.

  • Identifiers: Must begin with an alphabetic character or underscore (_).
  • Core Types: Integers, floating-point numbers (supporting e/E scientific notation), booleans (true, false), and null.
  • Strings: Wrapped in single or double quotes, supporting standard escape sequences and inline interpolation using {} braces.
  • Comments: Denoted by // or #.
  • example.ru
    # Variables & Interpolation
    lang = "RuLang"
    print("Welcome to {lang}!") # Welcome to RuLang!
    
    # Numbers & Booleans
    is_active = true
    pi = 3.14159
    scientific = 1e+5