News for hackers. Stuff that matters.
Re:PHP 8 to Add a JIT by beberlei on Sunday March 31, 2019 @12:15PM (#19536338)
Not sure if this qualifies as intermediate representation in the LLVM sense, but PHP has opcodes already, it is not fully interpreted anymore (like it was in PHP 3).

These opcodes are used for optimizations and cached for the lifetime of the PHP process (across multiple requests).

Re:PHP 8 to Add a JIT by pas on Sunday March 31, 2019 @12:42PM (#19536522)
That's probably too low-level. Usually an AST is needed that is void of all syntactic sugar, yet can express the required data flows and dependencies so the trivial substitutions/replacements/caching and refactorings can be done at this level.

Lower level bytecode lacks these higher level references (it usually has a lot of indices that index into raw lookup tables, but no real symbols that refer to results of computations and other variables).

Re:PHP 8 to Add a JIT by readittwice on Sunday March 31, 2019 @04:43PM (#19538247)
Not sure why you think this is the case: there are numerous JITs/VMs that optimize starting from bytecode e.g. all JVMs, WebAssembly, V8, JSC,...

Can you point me to some paper/reference about this? AFAIK it doesn't matter whether you have an AST or bytecode. Optimizations are done on an IR anyways.

Re:PHP 8 to Add a JIT by tyingq on Sunday March 31, 2019 @01:29PM (#19536857)
There does appear to be an internal AST in php7: https://github.com/nikic/php-ast
Re:PHP 8 to Add a JIT by jashmatthews on Sunday March 31, 2019 @01:54PM (#19537034)
LuaJIT and WebKit both produce their IR from the bytecode, IIUC.
Re:PHP 8 to Add a JIT by ryanmccullagh on Sunday March 31, 2019 @01:33PM (#19536877)
PHP has had an AST for years now.
Re:PHP 8 to Add a JIT by pas on Sunday March 31, 2019 @06:26PM (#19538833)
Of course, but the opcode is lower level than that. And that was what the parent comment mentioned.
Re:PHP 8 to Add a JIT by WalterGR on Monday April 01, 2019 @01:51PM (#19546017)
Usually an AST is needed that is void of all syntactic sugar,

That’s how I’ve always see “AST” used, but not the following:

yet can express the required data flows and dependencies so the trivial substitutions/replacements/caching and refactorings can be done at this level.

Is what you describe some flavor of ‘augmented’ AST? Does that have a name other than AST?