Skip to content

Latest commit

 

History

History
76 lines (46 loc) · 2.08 KB

README.md

File metadata and controls

76 lines (46 loc) · 2.08 KB

HippyVM

HippyVM is an implementation of the PHP language using RPython/PyPy technology.

HippyVM right now works only on 64bit linux on x86 platform (this limitation is temporary though, the RPython toolchain supports 32 and 64 bit x86, ARMv6 and ARMv7 on windows, os x and linux).

Building

  1. Install PyPy (Debian)

    $ sudo add-apt-repository ppa:pypy/ppa

    $ sudo apt-get update

    $ sudo apt-get install pypy

  2. You will need this repository, so please make yourself a "clone" :)

  3. Install Python dependecies from requirements.txt file. The usual way is to create a virtualenv and then inside, but installing system wide (with sudo) is possible as well. Then:

    pip install -r requirements.txt
    

    If pip is not aviliable, please check this.

  4. Install system packages:

    • libpcre-dev $ sudo apt-get install libpcre3-dev
    • php5
    • libffi5-dev
  5. Edit the PHP config (php.ini)

    Find and edit line to short_open_tag = On

    Not sure where the php.ini file is? Check this thread Dude, where's my php.ini?

  6. You'll need a source of the RPython translation toolchain. You may try cloning the whole repo but having a snapshot of PyPy is the easiest way to get it fast.

  7. Building goes like this (in hippyvm main directory):

    python <path to pypy>/rpython/bin/rpython -Ojit targethippy.py
    

    This will create a hippy-c binary that works mostly like a php cli without readline support.

Running it

You can run it with ./hippy-c <file.php>. Example of benchmarks are in bench/ subdirectory.

Tests

You'll need py.test:

pip install pytest

To run tests fot hippyvm:

py.test testing/

to run PHP's test on the top of the hippyvm interpreter:

py.test test_phpt/