Metadata-Version: 2.1
Name: the-pyro-lang
Version: 4.0.1
Summary: A friendlier Python that compiles to Python — readable by default
Home-page: https://github.com/pyro-lang/pyro
Author: Pyro Contributors
License: MIT
Project-URL: Homepage, https://github.com/pyro-lang/pyro
Project-URL: Bug Reports, https://github.com/pyro-lang/pyro/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# Pyro – A friendlier Python (v4.0.0)

Pyro is a programming language built around one core philosophy: **"Readable by default."** If you can say it in English, you can write it in Pyro.

It removes Python's rough edges—like indentation errors, mandatory `self`, and `def`—and introduces highly readable constructs like `unless`, `repeat 5 times`, `match ... case`, `async ... await`, and `data` classes. 

The best part? It **compiles exactly to standard Python bytecode** and supports seamless interoperability. You can import `.py` files from `.pyro`, and you can even `import pyro_module` directly from regular Python files!

## ✨ New in 4.0.0
Pyro 4.0.0 is a massive upgrade that brings modern language features, a comprehensive build system, and first-class IDE tooling to the ecosystem:
- **Pattern Matching**: `match subject: case value:` syntax with `if` guards.
- **Async capabilities**: Full support for `async func`, `await`, `async with`, and `async for`.
- **Enums and Data Classes**: Built-in keywords `enum` and `data` (immutable dataclasses).
- **Tooling**: A built-in LSP (`pyro lsp`), an interactive debugger (`pyro debug`), a document extractor (`pyro doc`), and an executable packager (`pyro build`).
- **Standard Library**: A cleanly wrapped `pyro.stdlib` featuring `http`, `fs`, `json`, `math_extras`, `process` and more.
- **Build optimizations**: Automatic byte-caching `.pyro.pyc` and constant-folding.

## The Python vs. Pyro Difference

| Feature | Python | Pyro |
|---------|--------|------|
| **Blocks** | Indentation sensitive | `if ... end` (no indentation errors) |
| **Functions** | `def` or `lambda` | `func`/`fn` and `lambda` |
| **Object Scope** | `self.name` | `this.name` |
| **Variables** | `x = 1` | `make x: int = 1` or `x = 1` |
| **Ranges** | `range(1, 6)` | `1..5` (inclusive) |
| **Match/Case** | `match x: case 1:`| `match x: case 1:` (with `_ if` guards)|
| **Enums** | `from enum import Enum` | `enum Color: RED GREEN BLUE end` |
| **Dataclasses**| `@dataclass` | `data Point(x: int, y: int) end` |
| **Print Output**| `print("hi")` | `print "hi"` (or with parens) |

## Installation

To install Pyro globally (works flawlessly from a USB drive across Linux/Windows/Mac):

```bash
# In the project root directory:
pip install .
```

*Note: This automatically registers the `pyro.pth` hook into your site-packages, completely unlocking Python global interoperability!*

## Zero-Config Python Interop (`# coding: pyro`)

You can tell Python to natively run a `.py` file as Pyro syntax. Just add this to the very top:

```python
# coding: pyro

print f"This is actually Pyro code!"
repeat 3 times
    print "Magic!"
end
```
When you run `python script.py`, Python detects the codec, transpiles it instantly in memory, and runs it seamlessly.

## Quick Examples

```pyro
print "Hello from Pyro 4.0!"

# Variables & String Interpolation
make name = "Pyro"
make v = 4
print f"Welcome to {name} v{v}"

# Pattern Matching
func http_status(code):
    match code:
        case 200:
            return "OK"
        case _ if code >= 500:
            return "Server Error"
        case _:
            return "Unknown"
    end
end

# Data Classes
data Point(x: int, y: int = 0):
end
p = Point(10)
print f"Point X: {p.x}"

# Enums
enum FileState:
    OPEN
    CLOSED
end

# Try / Catch / Cleanup
try:
    print 10 / 0
catch error:
    print f"Whoops: {error}"
cleanup:
    print "Moving on..."
end

# Repeat Loops
repeat 5 times:
    print "This is so readable!"
end
```

## Robust CLI

Pyro comes with a full suite of professional tools:

```bash
# Compile and run
pyro run script.pyro

# Build a standalone standalone executable out of your script (zero deps!)
pyro build script.pyro -n my_app

# Start the interactive debugger
pyro debug script.pyro

# Generate docs for your project
pyro doc script.pyro

# Start the Language Server for VS Code integration
pyro lsp

# Install Python packages safely into your environment
pyro install requests
```

## vscode-pyro Extension
To install the VS Code extension, open the `vscode-pyro` folder, run `npm install` and `npm run package` to create a `vsix` file and install it into your editor for real time syntax highlighting and auto-completion.

## License
MIT – use it anywhere, even in commercial projects.
