Skip to content

miedzinski/python-compiler

Repository files navigation

Python compiler

Python 3 implementation using LLVM.

Build instructions

This project is written in Rust and depends on LLVM 11 and Boehm GC. To compile file test.py:

macOS

Install Rust using rustup. LLVM and Boehm GC can be installed using Homebrew:

brew install llvm@11 libgc

Build compiler:

LLVM_SYS_110_PREFIX="$(brew --prefix)/opt/llvm@11/" cargo build --release

Build final executable:

target/release/python --emit=bc test.py
$(brew --prefix)/opt/llvm@11/bin/llc -filetype=obj test.bc
clang test.o -o test -Ltarget/release/ -lpython_core -lgc

License

MIT.

Copyright (c) 2021 Dominik Miedziński.

About

A compiler for a subset of Python using LLVM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published