Skip to content

How does peachpie work? (i need just a rough explanation) #1073

Answered by jakubmisek
gabrielesilinic asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, thanks for the question!

Public Roslyn API does not allow creating your own languages (it's basically hardcoded for C#, F#, and VB.NET).

So we have forked Roslyn's CodeAnalysis project, added [InternalsVisibleTo] so we can actually build a new language on top of Roslyn's IL builders and Symbols.

PeachPie is not a transpiler, it really emits its own metadata and produces regular DLL assemblies using low-level Roslyn metadata generators and IL builders. Nothing like "source generators" wouldn't be sufficient to compile PHP code. In majority of places, PeachPie compiler produces IL byte-code that has no equivalent in C# language (such as dynamic call sites, or PHP interfaces containing s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gabrielesilinic
Comment options

Answer selected by gabrielesilinic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants