Giter Club home page Giter Club logo

lpython's Introduction

LPython

LPython is a Python compiler. It is in heavy development, currently in pre-alpha stage. Some of the goals of LPython:

  • The best possible performance for numerical array oriented code
  • Run on all platforms
  • Compile a subset of Python and be Python compatible
  • Explore how to design it so that it can be eventually used with any Python code
  • Fast compilation
  • Excellent user friendly diagnostic messages: error, warnings, hints, notes, etc.
  • Ahead of time compilation to binaries and interactive usage (Jupyter notebook)
  • Able to transform the Python code to C++, Fortran and other languages

And more.

Installation

LPython works on Windows, macOS and Linux.

Install Conda

If you do not have Conda already installed, please follow the instructions here to install Conda on your platform:

https://github.com/conda-forge/miniforge/#download

Compile LPython

Create a Conda environment:

conda create -n lp llvmdev=11.0.1 bison=3.4 re2c python cmake make toml numpy
conda activate lp

Install required packages (Linux - 64 bit):

sudo apt install binutils-dev zlib1g-dev

Clone LPython

git clone https://github.com/lcompilers/lpython.git
cd lpython

Create autogenerated files (choose the command for your platform):

./build0.sh      # macOS/Linux
call build0.bat  # Windows

Compile LPython:

cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=yes -DWITH_STACKTRACE=yes -DWITH_LFORTRAN_BINARY_MODFILES=no .
cmake --build . -j16

Tests:

Run tests:

ctest
./run_tests.py

Also, run the integration tests:

./integration_tests/run_tests.py

Examples

You can run the following examples by hand in a terminal:

./src/bin/lpython examples/expr2.py
./a.out
./src/bin/lpython --show-ast examples/expr2.py
./src/bin/lpython --show-asr examples/expr2.py
./src/bin/lpython --show-cpp examples/expr2.py
./src/bin/lpython --show-llvm examples/expr2.py

Contributing

We welcome contributions from anyone, even if you are new to open source. It might sound daunting to contribute to a compiler at first, but please do, it is not complicated. We will help you with any technical issues and help improve your contribution so that it can be merged.

To contribute, submit a Pull Request (PR) against our repository at:

https://github.com/lcompilers/lpython

Please report any bugs you may find at our issue tracker: https://github.com/lcompilers/lpython/issues. Or, even better, fork the repository on GitHub and create a PR. We welcome all changes, big or small, and we will help you make a PR if you are new to git.

If you have any questions or need help, please ask us at Zulip (project chat) or our mailinglist.

See the CONTRIBUTING document for more information.

lpython's People

Contributors

certik avatar czgdp1807 avatar thirumalai-shaktivel avatar namannimmo10 avatar smit-create avatar dpoerio avatar haozeke avatar hsnyder avatar implicitall avatar bughunterstudios avatar hp77-creator avatar sc0rpi0n101 avatar awvwgk avatar ansharlubis avatar akshanshbhatt avatar anpandey avatar yumekamengjialyu avatar oshanath avatar

Stargazers

Pratyush Raj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.