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
Metadata
Release files for polyprime 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polyprime-0.2.0.tar.gz | 11.6 kB | Without provenance | Details for polyprime-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polyprime-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for polyprime-0.2.0-py3-none-any.whl |
Total release size: 21.8 kB
Release files / polyprime-0.2.0.tar.gz
| Download URL | polyprime-0.2.0.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e93f41233357c27254dd6ea3f16a9373b934e5a7c3d0a910e8b6753789913d14
|
|
BLAKE2b-256 checksum How to use checksums |
b7edea17e74cc10773550624874cc378dd62d250cba9a40489b4b0cb6d007b7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / polyprime-0.2.0-py3-none-any.whl
| Download URL | polyprime-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca19f49dd9335fa083dad8c11866c80cb2487264183c172238d52e5ed1f7a348
|
|
BLAKE2b-256 checksum How to use checksums |
ded9ad97ebc62ee7b7af034394d652f24b17ce795a986b5086f2e6fb5c4e5aa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for polyprime 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.