views:

118

answers:

3

Update:

This question is a duplicate of http://stackoverflow.com/questions/375542/

The answers given here appear to be disjoint from those given at the other node, so this question was not (yet) deleted. If possible, please merge the answers here into the other node.

Question:

Is there any such thing as a programming language (other than an esoteric language such as BrainF@#$, or the languages PHP or VB) that you can "compile" into non-obfuscated PHP source code?

Rationale:

Swip wants to generate ordinary PHP code because it is so ubiquitous for the types of projects swip wants to do. Unfortunately swip would like to actually avoid writing PHP -- strange but true! Swip is crazy enough to want to generate PHP source code without having to type any PHP into Swip's editor.

A: 

I don't know what swip is, but this is not really possible. There are tools to aid the programmer in doing this, but they will not run without deep human interaction and refactoring. What you want is a skilled programmer.

Edit I think I misunderstood, you want a scripting language to script PHP? While php compiles to bytecode internally, it isn't like java or .net where you can use different languages to do it. What are you trying to accomplish?

Byron Whitlock
A: 

Wasabi compiles down to PHP, but you'll have to beg Joel Spolsky for a copy.

amarillion
+3  A: 

Take a look at

http://github.com/juliend2/phlower

This project claims about itself:

phlower (pronounced flower) is a small ruby script that compiles the Awesome code (invented by MACournoyer for his book void://createyourproglang.com/ ) into PHP code. This script is written in Ruby and it depends on the racc gem.

stepmoz