Best way to implement a meta language compiling down to PHP

1.5k views Asked by At

I've been working on the specification / kitchensink for a meta language that can compile down to PHP for some time now. Now I want to begin building the thing. Before I have implemented tiny DSL's using PHP_Lexergenerator and PHP_Parsergenerator and they have worked very well but I have never build anything this scale before. I would appreciate any feedback / suggestions / experiences you may have greatly!

I pasted the spec at http://pastebin.com/613mFGsB.

3

There are 3 answers

2
user187291 On

pihipi was an interesting example of this, but now I've killed it. So check out Haxe: Haxe is a language that implements PHP as a compilation target. It seems similar to what you're trying to achieve. It's OSS, so you could take a look at how they do it.

0
TravisO On

Don't let similar projects by other people stop you from doing this anyways. No matter how far you get with this, what you'll really get out of this project is a further understanding of coding and parsing. You won't gain this knowledge as in depth if you simply join an existing project.

I'd also like to point out, things like Linux, Ubuntu, etc would have never existing if their original makers simply "jumped on the boat" of somebody else's similar project. Don't be afraid to make things yourself, sometimes greatness comes out of it.

1
Alex J On

Haxe is a language that implements PHP as a compilation target. It seems similar to what you're trying to achieve. It's OSS, so you could take a look at how they do it.