Skip to content

Tomek20225/pytc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyTC

Python compiler written in Rust that transpiles Python bytecode to LLVM IR for optimized native compilation.

The tool's goal is to speed up Python code by:

  1. Generating Python bytecode through CPython's .pycache files
  2. Parsing and mapping the bytecode structure in Rust
  3. Converting the bytecode to LLVM Intermediate Representation (IR)
  4. Using LLVM's powerful optimization passes to generate highly optimized native code

This approach leverages LLVM's mature optimization pipeline and cross-platform capabilities, allowing for efficient native code generation across different architectures.

Requirements:

  • Python 3.10.2 (CPython implementation)
  • LLVM 16.0.4

Todo:

  • Generation and decompilation of .pycache files based on the .py files
  • Variable declaration
  • Integer addition and subtraction
  • Printing to console
  • Mapping of all primitive and non-primitive types
  • Mapping of all operations
  • User-defined functions
  • Python standard library mapping
  • Imports and modules
  • Comprehensive test suite
  • Benchmarks

References:

Examples

Docs

Random

About

Python compiler written in Rust and LLVM

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published