jphp-group / jphp

JPHP - an implementation of PHP on Java VM
http://jphp.develnext.org
Apache License 2.0
1.71k stars 160 forks source link

Maybe this should get refactored to use GraalVM and be the graalphp implamentation #379

Open frank-dspeed opened 4 years ago

frank-dspeed commented 4 years ago

Hi there is at present an effort to implement graalphp i think it would be nice to have you involved if you are not aware about graalvm at present https://www.youtube.com/watch?v=8AYESZIaacg what do you think?

dim-s commented 4 years ago

The truffle project is an interesting thing, but at the moment it does not support ARM platform, for example, android. To develop a language for the GraalVM, it's necessary to rewrite a lot, a fully compiler, a runtime library and probably extensions developed for it.

It will take a lot of time, just for the sake of performance. In my opinion, it’s too early to take on the development of a compiler for GraalVM. PHP 8 with JIT support is coming soon, which will have excellent performance.

In any case, when the Grail VM project becomes more cross-platform, I will probably take up this task.

frank-dspeed commented 4 years ago

@dim-s arm support is there! and no we need only a AST parser and a interpreter thats it compiler gc and ecosystem comes from the graalvm compiler

frank-dspeed commented 4 years ago

https://www.graalvm.org/docs/release-notes/19_3/ there is graalvm arm64

frank-dspeed commented 4 years ago

@dim-s https://github.com/direktspeed/graalphp/issues/3 as pointed out there @abertschi will do the main implamentation over the next 7 month as a thesis for TH Zurich i would say we both prepare to jump into that after he has finished his thesis so we can expand on that fast. What do you think=?

dim-s commented 4 years ago

Now Java VM already provides GC. It's probably possible to write a translator from the current AST to AST of GraalVM. It’s still not clear how to integrate the Memory classes into the Graal VM (https://github.com/jphp-group/jphp/blob/master/jphp-runtime/src/php/runtime/Memory.java). These classes are the main element of the jphp runtime and many extensions use them.

We need to figure out how to implement support for Java VM and Grail VM without breaking backward compatibility.

dim-s commented 4 years ago

will do the main implamentation over the next 7 month as a thesis for TH Zurich i would say we both prepare to jump into that after he has finished his thesis so we can expand on that fast. What do you think=?

I will be happy for your help in the development of the project.

frank-dspeed commented 4 years ago

@dim-s jump into https://github.com/direktspeed/trufflephp/blob/master/language/src/main/java/kis/phpparser/truffle/PHPNodes.java

there are scripts in the root folder to test it https://github.com/direktspeed/trufflephp :dancing_men:

dim-s commented 4 years ago

@frank-dspeed Have you compared performance with the latest version of php (7.4+)?

frank-dspeed commented 4 years ago

its is far from beeing complet it is only for your education the frind from ETH Zurich will do a far more complet implamentation but good new is we do not need the memory managment stuff :)

frank-dspeed commented 4 years ago

and other frameworks like JRUBY also did the transfer to graal without problems overall its a matter of time but because performance there is a .pdf in the repo root open it it got benchmarks in it do not fear the chineese lang

frank-dspeed commented 4 years ago

@dim-s https://github.com/abertschi/graalphp is out of thesis phase and reaches in the "benchmark game" up to 854% compared to the standard php implementation