Giter VIP home page Giter VIP logo

cjluzzl / graalpython Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oracle/graalpython

0.0 1.0 0.0 116.7 MB

A Python 3 implementation built on GraalVM

License: Other

Python 61.57% R 0.01% Makefile 0.02% C 9.60% C++ 0.09% Java 28.06% ANTLR 0.14% Shell 0.08% Batchfile 0.01% HTML 0.34% CSS 0.01% Roff 0.04% DTrace 0.01% PLSQL 0.04% PowerShell 0.02% Jsonnet 0.01% VBScript 0.01% XSLT 0.01%

graalpython's Introduction

GraalVM Implementation of Python

This is an early-stage experimental implementation of Python. A primary goal is to support SciPy and its constituent libraries. GraalPython can usually execute pure Python code faster than CPython (but not when C extensions are involved). GraalPython currently aims to be compatible with Python 3.8, but it is a long way from there, and it is very likely that any Python program that uses more features of standard library modules or external packages will hit something unsupported. At this point, the Python implementation is made available for experimentation and curious end-users.

Trying it

The easiest option to try GraalPython is Pyenv, the Python version manager. It allows you to easily install different GraalPython releases. To get version 20.2, for example, just run pyenv install graalpython-20.2.

To try GraalPython with a full GraalVM, including the support for Java embedding and interop with other languages, you can use the bundled releases from www.graalvm.org.

If you want to build GraalPython from source, checkout this repository and the mx build tool, and run mx --dy /compiler python-gvm in the graalpython repository root. If the build is fine, it will print the full path to the graalpython executable as the last line of output.

For more information and some examples of what you can do with GraalPython, check out the reference.

Create a virtual environment

The best way of using the GraalVM implementation of Python is out of a virtual environment. To create the venv, run the following:

graalpython -m venv <dir-to-venv>

To activate the environment in your shell session call:

source <dir-to-venv>/bin/activate

In the venv multiple executables are available, like python, python3 and graalpython.

Installing packages

At the moment not enough of the standard library is implemented to run the standard package installers for many packages. As a convenience, we provide a simple module to install packages that we know to be working (including potential patches required for those packages). Try the following to find out which packages are at least partially supported and tested by us in our CI:

graalpython -m ginstall install --help

As a slightly exciting example, try:

graalpython -m ginstall install pandas

If all goes well (also consider native dependencies of NumPy), you should be able to import numpy and import pandas afterwards.

Support for more extension modules is high priority for us. We are actively building out our support for the Python C API to make extensions such as NumPy, SciPy, Scikit-learn, Pandas, Tensorflow and the like work fully. This work means that some other extensions might also already work, but we're not actively testing other extensions right now and cannot promise anything. Note that to try other extensions on this implementation, you have to download, build, and install them manually for now.

Polyglot Usage

We have a document describing how we implement the cross-language interop. This will hopefully give you an idea how to use it.

Jython Support

We are working on a mode that is "mostly compatible" with some of Jython's features, minus of course that Jython implements Python 2.7 and we implement Python 3.8+. We describe the current status of the compatibility mode here.

Contributing

I you're thinking about contributing something to this repository, you will need to sign the Oracle Contributor Agreement for us to able to merge your work. Please also take note of our code of conduct for contributors.

To get you started, we have written a bit about the structure of this interpreter that should show how to fix things or add features.

Licensing

This GraalVM implementation of Python is copyright (c) 2017, 2019 Oracle and/or its affiliates and is made available to you under the terms the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. This implementation is in part derived from and contains additional code from 3rd parties, the copyrights and licensing of which is detailed in the LICENSE and THIRD_PARTY_LICENSE files.

graalpython's People

Contributors

timfel avatar fangerer avatar msimacek avatar cosminbasca avatar ppisl avatar otethal avatar tomasstupka avatar steve-s avatar lukasstadler avatar qunaibit avatar zapster avatar ansalond avatar olyagpl avatar gilles-duboscq avatar chumer avatar martinbalin avatar jirkamarsik avatar fniephaus avatar boris-spas avatar tzezula avatar rschatz avatar kolpa avatar eregon avatar farquet avatar numberpi avatar entlicher avatar hguiroux avatar milanpro avatar mohamedrez avatar woess avatar

Watchers

James Cloos 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.