Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Has anyone attempted to create a PHP to Perl converter?

by einhverfr (Monk)
on Nov 18, 2013 at 05:42 UTC ( #1063040=note: print w/ replies, xml ) Need Help??


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?

I am not so sure. The thing is that natural languages aren't really that analogous to programming languages here, because they aren't that ambiguous. Natural languages are defined by use, not by specification. Programming languages are defined by specification and not by use. Of course that specification is written in a language defined by use, but since you have only one canonical implementation of PHP and only one of Perl, you might be able to say that the implementation is authoritative. Because in the end, the basic structures are identical, you shouldn't have problems translating programming languages that you do with natural languages.

But that leads to a big problem in that to be perfect, a perfect converter would have to translate bug for bug but that's not very feasible, but you could still have something which manages those to an extent. You could have wrapper classes for ordered maps and translate PHP arrays to that. However very likely what you would have to end up with is a program that converts from PHP into a Perl framework built for the conversion.

Now where I think your point holds some real weight is in the management of code comments. What does the program do with those? Just ignore them? Just include them? Both of those seem dangerous, and you can't translate them for the reason you mentioned.


Comment on Re^2: Has anyone attempted to create a PHP to Perl converter?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063040]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-09-19 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (144 votes), past polls