i wonder, if there's any transpiler available, which converts (simple) php code to javascript?
what i am not looking for is ajax stuff or javascript libraries imitating php functionality, but i am looking for a translater, which is able to generate javascript code from php code (similar of what google is doing with GWT and the java-to-javascript transpiler).
afaik GWT is a compiler, not a transpiler; transpilers in general aren't terribly useful and will most likely only work for special cases because of the differences in type systems/standard libraries
I prefer the term cross-compiler, too, but the term transpiler is starting to get used more and more often these days. We'll see if it catches on. At least in the JavaScript world, I think it just might. But I agree with your sentiment. I tend to think CoffeeScript to JavaScript is a transpiler, but Java to JavaScript, not so much. Others disagree. We'll see what people are saying a year from now.
You can use something like this: http://www.harmony-framework.com/ But notice, that Javascript has lots of security issues PHP avoids. And straight conversion is not always possible for Database-related function calls or some other PHP extensions
my comment to the question applies: eg, harmony translates array($a => 'foo') to {a : 'foo'}; depending on the problem harald is trying to solve, something like haxe.org which can compile to both PHP and JS might be a better solution
mmm -- harmony seems to be a little outdated -- the webpages last change was in 2008. do you know, if they are still working on it? i think harmony would fit my needs better than haxe, even though haxe seems to be very advanced. but i don't know how i would integrate haxe with my app, because my app is already implemented in php ... only the php->javascript part is missing, which would help speed up development and make things more convenient ...
@harald: if you look at the svn commit feed of harmony ( code.google.com/feeds/p/harmony-framework/svnchanges/basic ), you'll see that development is slow, but I don't think it's dead; the documentation an how to wrap PHP code for haxe seems somewhat... incomplete: haxe.org/doc/php/extern_libraries ; if all that's missing from your application is some JS, porting it to haxe will be overkill