Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to implement a meta language compiling down to PHP

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.

like image 441
Rune Kaagaard Avatar asked Dec 18 '22 02:12

Rune Kaagaard


2 Answers

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.

like image 149
TravisO Avatar answered Jan 22 '23 05:01

TravisO


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.

like image 33
Alex J Avatar answered Jan 22 '23 05:01

Alex J