in reply to Re: Has anyone attempted to create a PHP to Perl converter?
in thread Has anyone attempted to create a PHP to Perl converter?

> a stream of PHP tokens (in PHP!), build up an abstract syntax tree and then compile that down to Perl.

You can't handle PHP's 'eval($string)' if you parse the syntax in PHP.

> In fact, somebody's already done the hard part.

Nope, the hard part of translating dynamic languages (apart eval) is the realization of implicit type coercions in all edge cases.

This can get so complicated that you might need to treat every single variable / data structure as a tied object.

After estimating the speed of such programs most similar projects crumble away.

edit

You effectively need a nifty JIT compiling magic which notices that weird edge cases aren't touched and resorts to efficient code.

Cheers Rolf

( addicted to the Perl Programming Language)