Skip to content
forked from hippyvm/hippyvm

HippyVM - an implementation of the PHP language in RPython

License

Notifications You must be signed in to change notification settings

shendel/hippyvm

 
 

Repository files navigation

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/

About

HippyVM - an implementation of the PHP language in RPython

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 83.4%
  • Python 12.4%
  • C 4.1%
  • Shell 0.1%