Getting started

Welcome to reStructuredPython! 🎉 This guide will walk you through installing the compiler, writing your first .repy program, and compiling or running it.

What is reStructuredPython?

reStructuredPython (aka rePython) is a superset of Python designed to:

  • Use modern syntax inspired by JavaScript, C#, C/C++ and many other languages

  • Compile back to 100% standard Python

  • Support modular language features (like |> pipelines, braced blocks, multiline comments, and optional optimizations)

It’s designed to look modern, feel powerful, and remain compatible with the Python ecosystem.

Installation

Install the latest version using pip:

pip install --upgrade restructuredpython

Make sure repy and repycl are now available in your terminal:

repy -h
repycl -h

Writing Your First Program

Create a file named hello.repy:

/* This is a multiline
comment */

#hello.repy
name = "sharktide"
def say_hello(name) {
    print("reStructuredPython is Awesome!")
    return name
}
def say_bye(name) {
print(f'Bye {name}')
}
name |> say_hello |> say_bye

Transpile or Run

To compile .repy into .py:

repy hello.repy

This will generate hello.py.

To compile and run the program:

repycl hello.repy

The repycl command handles compilation and runtime execution, especially for features like optimize_loop and strict_types.

Next Steps

  • 📚 Explore the Syntax Guide for full syntax support

  • ⚙️ Learn more about repy and repycl

  • 🚀 Check out some of the features

Happy coding!