Python to PHP Translation Needed
View Single Post
10-03-2009, 08:50 PM
Join Date: Sep 2009
Well... I first tried QT using the php extension and I could not really get my head around it.
After I did it in C++, the php extension was easy. BUT it's not really that useful, because nobody ships it. Debian, for instance, had a proposition to package it but then threw it out because at the time it was only available under the GPL, which according to FSF is incompatible with the PHP license due to a an "obnoxious advertising clause" or something (The PHP license forbids the use of the name "PHP" in derivative works).
Now QT is available under the LGPL and I don't think that restriction applies under the new license, but we've gone around in a full circle. Regardless of its legal status, no distribution that I know of ships a package for PHP-QT. I don't think it's in PECL either.
It's really a fantastic extension - one that you can't use in redistributable code unless you box the extension up with your code, but still fantastic... And then in that case, as you say, these sorts of obstacles start making look C++ look much more attractive.
Having said all that, bigger picture, time for threadjacking. There's no reason to not use PHP in desktop apps at least privately. The "It's only for the web" argument doesn't really work, and neither does "but it's not a compiled language".
Frozen-bubble, gstreamer, cowsay and gnome-system-tools all want to use PERL for something or other.
Eclipse, Mercury Messenger, Azureus and a number of other programs are written in humble Java. Java was first made public in 1995 targeting web applications (although they had originally intended it for embedded systems, say in appliances).
The team originally considered using C++, but it was rejected for several reasons. Because they were developing an embedded system with limited resources, they decided that C++ demanded too large a footprint and that its complexity led to developer errors. The language's lack of garbage collection meant that programmers had to manually manage system memory, a challenging and error-prone task. The team was also troubled by the language's lack of portable facilities for security, distributed programming, and threading. Finally, they wanted a platform that could be easily ported to all types of devices.
I used to use an instant messaging client called imvu (before it became a chat client and game), which is a Windows program written in Python.
PHP, has a purpose-built desktop executable (php-cli).
Also, PHP applications can be
and can even ship as
PHP has its roots as a scripting language for the web, and there's a reason it's so popular there, but it is in good company on the desktop.
Nothing beats the satisfaction of doing it in C++ (although I've only ever completed one GUI project in C++), but scripting languages are a valid choice too.
I sound like I disagree, and I know I wrote a long post... It's really not silly to do it in PHP! But... Yeah, C++ is usually "the tool for the job". Especially when you're working with QT.
View Public Profile
Send a private message to SneakyWhoami
Find More Posts by SneakyWhoami