A multi-paradigm programming language that compiles to Python, JavaScript, and more
Project description
PolyPrime 🎯
PolyPrime is a multi-paradigm programming language that compiles to multiple target languages including Python, JavaScript, and more. Write once, deploy everywhere.
✨ Features
- 🎯 Multi-Target Compilation: Compile to Python, JavaScript, with more targets coming
- 🚀 Simple Syntax: Clean, easy-to-learn syntax inspired by modern languages
- 🔧 Extensible: Easy to add new compilation targets
- 📦 Lightweight: Minimal dependencies, fast compilation
- 🎨 Modern: Designed for today's polyglot development environment
🚀 Quick Start
Installation
pip install polyprime
Your First Program
Create a file hello.pp:
function main() {
let message = "Hello, PolyPrime!";
print(message);
return 0;
}
Compile and run:
# Compile to Python
polyprime compile hello.pp --target python
# Compile to JavaScript
polyprime compile hello.pp --target javascript
# Run directly
polyprime run hello.pp
📝 Language Syntax
Variables
let x = 42; // Mutable variable
const pi = 3.14159; // Immutable constant
Functions
function add(a, b) {
return a + b;
}
function greet(name) {
print("Hello, " + name);
}
Control Flow
if (x > 0) {
print("Positive");
} else {
print("Non-positive");
}
for (i = 0; i < 10; i++) {
print(i);
}
while (condition) {
// loop body
}
🎯 Compilation Targets
| Target | Status | Extension |
|---|---|---|
| Python | ✅ Ready | .py |
| JavaScript | ✅ Ready | .js |
| TypeScript | 🚧 Coming Soon | .ts |
| Rust | 🚧 Planned | .rs |
| Go | 🚧 Planned | .go |
🛠️ CLI Usage
# Initialize a new project
polyprime init myproject
# Compile a file
polyprime compile source.pp --target python
# Run a program
polyprime run source.pp
# Show version
polyprime --version
# Get help
polyprime --help
📦 API Usage
from polyprime import Compiler
# Create compiler instance
compiler = Compiler()
# Compile source code
source = """
function main() {
let x = 42;
return x;
}
"""
# Compile to Python
python_code = compiler.compile(source, target="python")
print(python_code)
# Compile to JavaScript
js_code = compiler.compile(source, target="javascript")
print(js_code)
🎯 Use Cases
- Educational: Learn programming concepts that translate across languages
- Prototyping: Quickly prototype in one language, deploy in another
- Migration: Gradually migrate codebases between languages
- Polyglot Teams: Let team members work in a unified syntax
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📚 Documentation
For more detailed documentation, visit our GitHub repository.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author
Michael Benjamin Crowe
- Email: michael@crowelogic.com
- GitHub: @MichaelCrowe11
🙏 Acknowledgments
- Inspired by modern programming language design
- Built with Python for maximum portability
- Designed for the polyglot programming era
Ready to write once and deploy everywhere? Install PolyPrime today!
pip install polyprime
Project details
Release history Release notifications | RSS feed
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 polyprime-0.1.0.tar.gz.
File metadata
- Download URL: polyprime-0.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7ce6714cb2d56f9cc9cc45115737d1ab72d23506cdfc2a947308ab05d364ac8
|
|
| MD5 |
9499518bd4b14144db6dbb043cbcef38
|
|
| BLAKE2b-256 |
b48b08e7ff2539ef57fa6e94e52305a6657aff14b71f6263d79497201631b0f4
|
File details
Details for the file polyprime-0.1.0-py3-none-any.whl.
File metadata
- Download URL: polyprime-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c43515f8ed578fbd6b55c300a13b62ab2c19af5ac5ac39be294fe7e53f7fc515
|
|
| MD5 |
57ce127dc863a540f0788191ca0fcc04
|
|
| BLAKE2b-256 |
f54d8e3a139b6631c9c02dcab46465f79ae80cfac0858c17beea458dcedfa3b9
|