Skip to content

mhinkie/abstrakte_maschinen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Interpreters written in GO (and C)

Comparison of stack and register implementations of interpreters for a subset of PHP. The interpreters were tested using predefined php-files (fib.php, prime.php...). There are 4 versions: 1 register-interpreter written in GO, 2 stack-interpreters written in GO, and 1 stack interpreter written in C. An overview of the design choices (and errors) can be found in my presentation.

prerequesites

Directories

The version-directories (v1, v2, v3) each contain scripts to run the interpreter (including the compiler) - e.g.:

cd v1
./mphp_stack.sh ../benchmarks/fib.php

Note: The programs might have to be recompiled (depending on system). Run make in the respective compiler_stack/compiler_reg and interpreter_stack/interpreter_reg directories.

v1

Version 1 of stack and register interpreters (and compilers) written in GO.

v1_analyse

Version 1 interpreters with ability to record command runtimes.

v2

Version 2: New stack interpreter (reduced command set - no block entries or exists) written in GO.

v3

Version 3: New stack interpreter - this time written in C using direct threaded code. This interpreter uses the same compiler and command-set as v2.

benchmarks

The results of the different benchmarks. A detailed (but not very well annotated) overview can be found in bm.ods. Also contains the source files for the 3 benchmarks.

About

Compiler, intermediate code and interpreters for PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published