Today is a good day to code

Writing a PHP Interpreter for Mides

Posted: May 7th, 2009 | Author: | Filed under: android, iPhone, java, mides, PHP, Programming | Tags: , , , , , , , | No Comments »

For the past few weeks I have been working on writing a PHP interpereter for Mides.  As I know that I am not allowed to do it for iPhone, as it would involve downloading and executing scripting code, which is not allowed.  I have only been looking at the tokenizer for the iPhone, while I have been looking at the full monty for Android.

I actually have gotten to the point where the tokenizer is passing a lot of my tests, but there is a lot of ground to cover with PHP. Tommy Carlier’s blog on writing a parser has helped tremendously.  Still, even after getting the tokenizer working, I have to write an interpreter to execute the tokens.  This involves implementing the many methods that PHP has built in, so it will be a while until I get that completely done.

I am pretty frustrated with Mides for iPhone, actually, I wanted it to be a full PHP implementation and editor, but until the Terms and Conditions change it isn’t worth the effort to build an entire PHP interpreter just to have the app rejected. I am still improving the iPhone version, and the next update should be a huge improvement over what is currently there.  I had to remove the nesting because I need the memory for documentation search as well as the PHP tokenizer that I am working on.  Overall, the next update for Mides will make it better, it will be close to what I was hoping for, but it will never be completely what I was hoping for on iPhone.

The Android version of Mides on the other hand is shaping up nicely.  The Android text view supports color so I have some syntax highlighting happening which doesn’t hurt performance on the G1 too badly.  The tokenizer is mostly done, and now I am designing the interpreter.  Development on Android is going a lot faster since I don’t have to worry quite as much about memory leaks, although if you try you can still make them happen.

At any rate that is why there haven’t been any updates for Mides in a while, I have been working on localization, parsers, and interpreters.  I am spending most of my time on the iPhone version of Mides, but it seems that I am getting farther with the Android version, go figure.