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 |
| 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 = 1 or x = 1 |
| Ranges | range(1,6) |
1..5 (inclusive) |
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
pip install pyro-lang
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file the_pyro_lang-0.1.4.tar.gz.
File metadata
- Download URL: the_pyro_lang-0.1.4.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82d851570f07bcedf47bbe031241c74809d2a92ca5ce1250c34d2b592db767fb
|
|
| MD5 |
217017c381e38b2f947498b9d73953d1
|
|
| BLAKE2b-256 |
52458184d394652a3670e5a18223f0e653c91f258356a30c36b93b9942e34bee
|
File details
Details for the file the_pyro_lang-0.1.4-py3-none-any.whl.
File metadata
- Download URL: the_pyro_lang-0.1.4-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f14ca0221e7b579e3e4980ae00f411fa1cf99d42d30f1a4ac5278bd0f9fd18e
|
|
| MD5 |
060a74c2acdb93a2e113a215cfb4b66d
|
|
| BLAKE2b-256 |
c2697422fc057150ee710b08e73f69a83d61d51086b3111586b432a6990b8b32
|