PHP Compiler in D Language

The D Language just hit stable release and I think I am going to revisit it for this upcoming project. It should be easier since the “official” language compiler is in C and D has really great support for it.

I intend on creating a planning Wiki leading up to the initial development. I want to start with the different foundation blocks before working my way up to more advanced topics. Meaning since it is a web language, I’m not going to support anything but web SAPIs. It would keep it simple. Work on CGI / FastCGI before getting into Apache Modules. It would be interesting if it was possible to support calling other languages also.

I want to have the planned syntax ready, incorporating some elements from Ruby, Python, and Java in the new spec. I’m going to have to maintain backwards compatibility to PHP 5, but I think this will be more of a whole another web language specifically learning from PHP.

Some of the foundations will include making a lot of core coding easier and allowing core extensions to also easily be written. The class based approach, hopefully, will make this possible while still maintaining speed overall. The goal is to have extensions be created as easily as in PHP or easier.

The goal is to also allow for syntax features to be added by using classes also. So mostly it would mean some hardcore programming of the elements, but bison and flex should be supported for later. Mostly it should only mean that the syntax tree is available for hooking in when needed when bison or flex. Should be useful to provide test cases before using bison and flex.

When to start

I’ll be working on the QGL Extension before I start a complicated project such as this one. I want to get the QGL extension as stable as possible to the point where it only needs to be touched up every once in a while when a new component is added or a feature is changed. I’m thinking between March and May, with the second part of May being where I make the most, if not all completed progress. Probably will mean I’ll have to rewrite a lot of the code for the updated components.

I plan on starting this project in June, first half or second half of the month. It should be interesting to say the least, I’ve been wanting to write a compiler for a few years now.

Looking more like a new language

I’ve been pondering it now and thinking about why I’m building it like PHP. Sure I know and love PHP, but some of the features will conflict with PHP and never be considered. I do want to write it such that the switch can either be made in a different file extension, using a declare or just parsing over and ignoring any possible syntax errors that are technically correct in both languages.

For example, I want to enable multitasking in one form, not directly giving complete control to the user, but allowing for branches to be made.

Possibly Related Posts:


Comments are closed.