

Show HN: Java to PHP Compiler - eridal

I had this crazy idea like some years ago.. I wasn&#x27;t expecting it be factible, and there&#x27;s still some semantic problems with this approach<p>Anyways, the whole idea was to take some java source, generate an AST, and output it back as syntactically correct PHP.<p>why? 50% fun + 50% exploration<p>So I have this really basic compiler, which can roughly output its own code; what&#x27;s still missing?<p><pre><code>    - static vs instance detection (-&gt; vs ::)
    - class&#x27; properties
    - method visibility
    - enums
    - inner types
    - annonymous classes
    - dealing with method overriding
</code></pre>
There&#x27;s a huge gap in the semantic area (eg: <i>String.format</i> vs <i>sprintf</i>) that is way out of scope for this hack.<p>Source: https:&#x2F;&#x2F;gist.github.com&#x2F;eridal&#x2F;a850a8a665a255b74d2c
======
freefouran
Interesting idea, you should clean it up into multiple files and put it on an
actual repository. If you compiled all of Java's libraries, would you be able
to self host the trans-compiler?

------
skibz
why have you not put it in a regular repo, yet? by the looks of it, this thing
is something far beyond a mere 'gist' :P

------
smilepet_26
Great work, it looks awesome.

