Power of Perl. Simplicity of Python. One Language.
Features • Quick Start • Documentation • Examples • Tools
English | Русский
Pyrl (Python + Perl) is a modern hybrid programming language that combines Perl's expressive power with Python's readability and simplicity. The language uses Perl's sigil-based variable system ($scalar, @array, %hash, &function) together with Python's control flow syntax and indentation.
- 🔥 Sigil Variables — intuitive type recognition by prefix
- 🐍 Python Syntax — familiar
if,for,while,defconstructs - 🐪 Perl Power — regular expressions, built-in operators
- 🗄️ SQLite Integration — native database operations
- 🌐 Web Server — built-in HTTP server with REST API
- 🤖 AI Model — pretrained model for code generation
$name = "Pyrl" # Scalar ($)
@numbers = [1, 2, 3] # Array (@)
%config = { # Hash (%)
"host": "localhost",
"port": 8080
}
&handler = { # Function (&)
return "Hello!"
}
def greet($name):
if $name:
return "Hello, " + $name + "!"
else:
return "Hello, World!"
for $i in range(5):
print($i)
$text = "Hello, World!"
if $text =~ m/World/:
print("Found!")
$result = $text =~ s/World/Pyrl/
$app = {
handle: &handle_request
}
def handle_request($req):
%response = {
"status": 200,
"body": "Hello from Pyrl!"
}
return %response
# Clone repository
git clone https://github.com/pyrl-lang/pyrl.git
cd pyrl
# Install dependencies
pip install -r requirements.txt# Interactive console
python pyrl_cli.py
# Execute file
python pyrl_cli.py examples/01_hello_world.pyrl
# Web server
python scripts/run_web_app.py examples/web_server_auth.pyrl# Start server
docker-compose up -d server
# Console
docker-compose run console| Document | Description |
|---|---|
| Language Documentation (EN) | Complete syntax and features reference |
| Документация языка (RU) | Полное описание синтаксиса и возможностей |
| VSCode Extension | Extension installation and usage |
| AI Model | Model training and inference |
| Docker Services | Containerization and deployment |
| Project Roadmap | Development plans |
| CHANGELOG | Version history |
Plugin for Visual Studio Code with syntax highlighting, autocompletion, and snippets.
cd vscode-pyrl
code --install-extension .Features:
- 🎨 Syntax highlighting
- 📝 Quick construction snippets
- 🔍 Variable autocompletion
Train your own model for Pyrl code generation:
# Generate model
python scripts/generate_model.py
# Training
python scripts/train_model.py --epochs 10
# Inference
python scripts/model_inference.pyThe repository includes a pretrained model:
- Location:
models/pyrl-model/ - Tokenizer: BPE, 10,000 tokens
- Architecture: Transformer-based
pyrl/
├── src/
│ └── core/
│ ├── lark_parser.py # LALR parser
│ └── vm/
│ ├── vm.py # Virtual machine
│ ├── builtins.py # Built-in functions
│ ├── builtins_db.py # SQLite functions
│ └── builtins_http.py # HTTP functions
├── vscode-pyrl/ # VSCode extension
├── scripts/
│ ├── generate_model.py # Model generator
│ └── train_model.py # Model training
├── models/pyrl-model/ # Pretrained model
├── examples/ # Code examples
├── docker/ # Docker configs
└── documents/ # Documentation
| File | Description |
|---|---|
| 01_hello_world.pyrl | Hello World |
| 01_variables.pyrl | Variables |
| 04_functions.pyrl | Functions |
| 06_classes.pyrl | Classes |
| 08_builtins.pyrl | Built-in functions |
| 20_perl_regex.pyrl | Regular expressions |
| web_server_auth.pyrl | Auth web server |
# Run all tests
make test
# Specific test
python -m pytest tests/test_vm.py -vSee PROJECT_ROADMAP.md for development plans.
- ✅ SQLite integration
- ✅ Web server with REST API
- ✅ AI model for code generation
- ✅ VSCode extension
- 🔄 JIT compilation
- 🔄 Standard library
- 🔄 Package manager
- 🔄 Debugger
We welcome contributions!
- Fork the repository
- Create a branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open a Pull Request
MIT License — use freely for any purpose.
Pyrl — bringing the best of Python and Perl together