Skip to main content

A friendlier Python that compiles to Python

Project description

Pyro – A friendlier Python

Pyro is a programming language that feels like Python but removes the rough edges: no indentation errors, no self, no mandatory print() parentheses, and blocks end with end.

It compiles to standard Python – so you can use any Python library (NumPy, Django, TensorFlow) without change.

Why Pyro?

Feature Python Pyro
Blocks Indentation sensitive if ... end (no indentation errors)
Function definition def func (standard) or fn (Mojo-style Fast execution path!)
Method first argument self this (shorter)
print print("hello") print "hello" (or with parens)
Colons after headers Required Optional
Variable assignment x = 1 make x: int = 1 or x = 1 (MyPy typing supported)
Ranges range(1,6) 1..5 (inclusive)
Functional Pipelines print(add(x, 10)) `x

🔥 NEW in v1.0.0 🔥

  • Beginner Tracebacks: Pyret-inspired visually pinpointed (^) error handlers.
  • Typing out-the-box: MyPy support for .pyro definitions.
  • Mojo Speeds: fn explicitly caches and wraps using numba.njit implicitly.
  • Browser Sandbox: Comes with an interactive HTML examples/browser_playground.html inspired by Brython/Skulpt.
  • MCU & Web Compilation: Use --target mcu or --target js (RapydScript) for direct integrations.

Example

print "Hello from Pyro!"

make x = 10
y = 20
print "Sum: " + str(x + y)

if x > 5
    print "x is large"
else
    print "x is small"
end

func greet(name)
    print "Hello, " + name
end

greet("world")

for i in 1..5
    print i
end

class Person
    constructor(name)
        this.name = name
    end
    func say_hello()
        print "My name is " + this.name
    end
end

p = Person("Pyro")
p.say_hello()

Installation

To install Pyro globally or to update to the latest v1.0.0 release:

pip install --upgrade the-pyro-lang==1.0.0

Usage

Compile a .pyro file to Python:

pyro compile input.pyro -o output.py

Run directly:

pyro run input.pyro

Or use as a Python module:

from pyro import compile_pyro
py_code = compile_pyro(source)
exec(py_code)

Roadmap

  • MVP (variables, arithmetic, if/else, loops, functions, classes)

  • Compile to Python source

  • Import system

  • Exception handling (try/catch)

  • List/dict comprehensions

  • Standalone bytecode compiler (direct .pyc output)

  • Self‑hosting (compiler written in Pyro itself)

Contributing

See CONTRIBUTING.md (to be added). For now, open issues or PRs on GitHub. License

MIT – use it anywhere, even in commercial projects.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

the_pyro_lang-1.0.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

the_pyro_lang-1.0.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file the_pyro_lang-1.0.0.tar.gz.

File metadata

  • Download URL: the_pyro_lang-1.0.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for the_pyro_lang-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3a946de0ba831f7b715b45ddd369ca3bc5c8bed2834e007bda0c2d2429ec96b9
MD5 7e4fa8d54f41419793213e5b39a1510f
BLAKE2b-256 46c7b9663e6813ea8a5f610d800d3ea99eaeee5a511fc58cd1fbbeacb68a08f2

See more details on using hashes here.

File details

Details for the file the_pyro_lang-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: the_pyro_lang-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for the_pyro_lang-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6959b728f00dd4b5cb077cbe99c5402fb1bb5c2dbe734bc6c31aa800478d0e7
MD5 c8ca34f36d577013dec769a24880ca6d
BLAKE2b-256 6c7f1204b37f535b8978c4573e91ac3f7548c1508e54e6fbfc2a9ab4f87b49c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page