Skip to main content

Multi-Language Transpiler Framework

Project description

Transpiler 🚀

A production-grade, multi-language transpiler framework. Parse source code from one language into a language-agnostic Intermediate Representation (IR), apply semantic passes, and generate source code in your target language.

CI PyPI License: MIT

✨ Features

  • Multi-Source Parsing: Support for C, Go, Java, JavaScript, Python, and Rust via tree-sitter.
  • Language-Agnostic IR: A robust internal representation that preserves semantics across paradigms.
  • Intelligent Passes: Built-in type inference and semantic analysis to ensure correctness.
  • Cross-Language Generation: High-quality code generation for all supported target languages.
  • Production Ready: Fully type-hinted, linted with Ruff, and verified with 100% test coverage.

🛠 Installation

From PyPI

pip install transpiler

From Source

git clone https://github.com/ahron-maslin/transpiler.git
cd transpiler
pip install .

For development (including testing and linting tools):

pip install -e ".[dev]"

🚀 Quick Start

Use the transpiler CLI to convert code instantly:

# Convert a Python script to JavaScript
transpiler example.py --to js

# Convert a C header to Rust
transpiler header.c --to rust

Example

Input (Python):

def fib(n: int) -> int:
    if n <= 1: return n
    return fib(n - 1) + fib(n - 2)

Command:

transpiler fib.py --to js

Output (JavaScript):

function fib(n) {
    if ((n <= 1)) {
        return n;
    }
    return (fib((n - 1)) + fib((n - 2)));
}

🧪 Development

We value code quality and maintainability.

Running Tests

pytest

Linting & Formatting

We use Ruff for linting and Black for formatting.

black src/ tests/
ruff check src/ tests/

Pre-commit Hooks

Ensure your changes meet our standards before committing:

pre-commit install

📦 CI/CD

  • CI: Every PR and push to master triggers our GitHub Actions suite, testing on Python 3.10-3.12.
  • Releases: Automated PyPI publishing on tag creation (e.g., git tag v0.1.0 && git push origin v0.1.0).

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transpiler-0.1.1.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transpiler-0.1.1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file transpiler-0.1.1.tar.gz.

File metadata

  • Download URL: transpiler-0.1.1.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for transpiler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 07196e7280f595c7238aaf2682354bbf52cd2012e83e4209e40afb29b2976e5e
MD5 acbfb859372e32e85c65e2a2121b62d4
BLAKE2b-256 88167c21c89c3e16cc70808876bdaa897c6a1b43fcbb2d74574bbeec80a0a3c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for transpiler-0.1.1.tar.gz:

Publisher: release.yml on ahron-maslin/transpiler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transpiler-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: transpiler-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for transpiler-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18fa6cf2fd84cee0695a538fecae006dcbd93337ce3614e36b6e6c8f9ff90478
MD5 5df5f8a0e5b0bb7d67f2830ddb47231f
BLAKE2b-256 5fe04fa565bb8b67e5d6b92bde99d8395a4274bb9cc564a72f3fff2171cf78d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for transpiler-0.1.1-py3-none-any.whl:

Publisher: release.yml on ahron-maslin/transpiler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page