jphp icon indicating copy to clipboard operation
jphp copied to clipboard

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

Open frank-dspeed opened this issue 5 years ago • 11 comments

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?

  • https://github.com/oracle/graal/issues/361

frank-dspeed avatar Mar 04 '20 09:03 frank-dspeed

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.

dim-s avatar Mar 04 '20 17:03 dim-s

@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 avatar Mar 05 '20 09:03 frank-dspeed

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

frank-dspeed avatar Mar 05 '20 09:03 frank-dspeed

@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=?

frank-dspeed avatar Mar 05 '20 14:03 frank-dspeed

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 avatar Mar 05 '20 15:03 dim-s

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.

dim-s avatar Mar 05 '20 15:03 dim-s

@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:

frank-dspeed avatar Mar 17 '20 10:03 frank-dspeed

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

dim-s avatar Mar 20 '20 07:03 dim-s

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 avatar Mar 20 '20 09:03 frank-dspeed

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 avatar Mar 20 '20 09:03 frank-dspeed

@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

frank-dspeed avatar Sep 16 '20 05:09 frank-dspeed