PyHP-pph / PyHP_pph

This repository serves as a centre for collaboration on the PyHP++# language. It will also include a functioning interpreter and compiler for PyHP++# once the standard is finalised.
https://www.reddit.com/r/PyHP_pph/
GNU Affero General Public License v3.0
23 stars 3 forks source link

Problem: how do we compile PHP? #13

Closed ghost closed 7 years ago

ghost commented 7 years ago

If the CIC is supposed to be the compiled interpreter-compiler, how will we compile it if it's written in PHP, an interpreted language?

Boscillator commented 7 years ago

I thought it was the compiler-interpreter-compiler, in that it compiles PyHP++# into the half compiled, half interpreted state.

ghost commented 7 years ago

That seems... odd. It also wouldn't work outside of a JIT environment, and I don't think anyone here wants to write an entire JIT compiler.

Boscillator commented 7 years ago

What if by compiled we meant compiled to byte code, or perhaps, transpiled. While not technically compiled, this option would be easier.

There also appears to be libraries for JITing, of course.

ghost commented 7 years ago

Ehhhh, I don't know if we want to go to the effort of building a transpiler/bytecode compiler for PHP just so we can build a compiler/interpreter for a different language.

ghost commented 7 years ago

Maybe it should just be a totally inappropriate name.

Boscillator commented 7 years ago

It doesn't need to be a bytecode compiler for PHP, we could invent the bytecode language. I also have some experience targeting python byte code, so that could be fun.

ghost commented 7 years ago

If you want to write one, go ahead!

ghost commented 7 years ago

I don't know much PHP, but it looks like there's a PHP compiler here. @alexbuzzbee was right - it is Compiled Interpreter-Compiler.

ghost commented 7 years ago

See also this and this.

villuna commented 7 years ago

Can someone explain how a compiled interpreter-compiler would work?

Kampfkarren commented 7 years ago

You write a program that interprets and compiles PyHP++# (perhaps to bytecode) and then you compile that program.