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