Thread overview
PHP embed
Apr 07, 2005
Gerdus van Zyl
Apr 07, 2005
Charlie
Apr 07, 2005
Andrew Fedoniouk
Apr 07, 2005
Gerdus van Zyl
Apr 08, 2005
Andrew Fedoniouk
Apr 08, 2005
Dejan Lekic
Apr 09, 2005
Chris Sauls
April 07, 2005
Has anybody tried to embed PHP in a D application?
I'm want to do a XUL runner application that uses PHP as a scripting language. According to me D is the perfect companion to PHP for heavy duty work.
April 07, 2005
> . According to me D is the perfect companion to PHP for heavy duty work.

I agree :)  ( Im actually writing a php-for-d-lib that will have alot of the core php funcs ).  Haven't tried to extend PHP using D yet, someone did get this working but ive lost the link :S, you tried searching the forum ?

Charlie!


"Gerdus van Zyl" <gvz@infireal.com> wrote in message news:d33gb6$2a52$1@digitaldaemon.com...
> Has anybody tried to embed PHP in a D application?
> I'm want to do a XUL runner application that uses PHP as a scripting
> language. According to me D is the perfect companion to PHP for heavy
> duty work.


April 07, 2005
Just curious.... what is wrong with ECMAScript (JavaScript)? What is in PHP better in principle than in JS?

( There is an implentation of JS in D according to DigitalMars site)

Andrew.


April 07, 2005
Andrew Fedoniouk wrote:
> Just curious.... what is wrong with ECMAScript (JavaScript)?
> What is in PHP better in principle than in JS?
> 
> ( There is an implentation of JS in D according to DigitalMars site)
> 
> Andrew. 
> 
> 

Nothing wrong with JavaScript, i use it every day.
PHP has a huge amount of libraries,code that you can use. Plus alot of developers. Object orientated code is also more traditional than PHP. Besides not many apps use PHP as scripting language (even thought its possible), so its a interesting thing to do : - )
ECMA/JavaScript does however have a few things i like more than in PHP, so if implementing PHP turns to be too difficult i'll use it.
April 08, 2005
"Besides not many apps use PHP as scripting language (even thought its
possible)"

Problem with embedding PHP is simple:
it did not have GC. Starting from version 4.0 it
got reference counting system though.

This works if you have short living scripts, e.g.
web page execution cycle:
create VM and memory sandbox -> run script
-> destroy VM and memeory sandbox .

But in other types of applications you should be extremely careful using it. Problem of cyclic references is the one COM is dying from.

Andrew.


"Gerdus van Zyl" <gvz@infireal.com> wrote in message news:d34ejs$t1a$1@digitaldaemon.com...
> Andrew Fedoniouk wrote:
>> Just curious.... what is wrong with ECMAScript (JavaScript)? What is in PHP better in principle than in JS?
>>
>> ( There is an implentation of JS in D according to DigitalMars site)
>>
>> Andrew.
>
> Nothing wrong with JavaScript, i use it every day.
> PHP has a huge amount of libraries,code that you can use. Plus alot of
> developers. Object orientated code is also more traditional than PHP.
> Besides not many apps use PHP as scripting language (even thought its
> possible), so its a interesting thing to do : - )
> ECMA/JavaScript does however have a few things i like more than in PHP, so
> if implementing PHP turns to be too difficult i'll use it.


April 08, 2005
Andrew, I actually couldn't think of better language for this job than ECMAScript. Mozilla produces an excellent, easily embeddable ECMAScript implementation in pure C , so it would be very easy to use it in D applications IMHO.

-- 
...........
Dejan Lekic
  http://dejan.lekic.org

April 09, 2005
Or you could just use DMDScript 1.05:
http://www.digitalmars.com/dscript/

-- Chris Sauls

Dejan Lekic wrote:
> Andrew, I actually couldn't think of better language for this job than
> ECMAScript. Mozilla produces an excellent, easily embeddable ECMAScript
> implementation in pure C , so it would be very easy to use it in D
> applications IMHO.
>