Re: Developing a browser (Firefox) extension with D

2009-11-18 Thread Justin Johansson

Frank Benoit wrote:

Justin Johansson schrieb:

I'm just wondering for a moment if D might be a good vehicle for
developing a browser extension for Firefox, or any other browser for
that matter.

Has anyone either considered doing, or has actually done, any browser
extension development with D and have some thoughts or experience to share?

Thanks for all feedback,
Justin Johansson


As an extension, there might be more than one extension running in one
Firefox process. Each extension written in D must bring in its own GC,
here comes the problem. The GC is implemented in D using signals, which
are global to the process. So if there are two D extensions, they will
get confused by each other. This is also the reason, i give up about
running D and Java in the same process. Also Java uses those signals for
its own GC.

But nevertheless, if you want to give it a try, the DWT firefox bindings
might be of interest for you.


Hi Frank,

Thanks for this very valuable information.  I was soon to post about D 
interoperability with JNI (Java Native Interface), but sounds like as 
you say D extensions for Java could also be problematic.  Okay if you 
are the only guy in there but big trouble if your extension is trying 
to co-exist with other vendor extensions in D.


I am left wondering though, is this a permanent show-stopper for the 
future (technically) or could something, at least in theory, be worked 
out to overcome the GC issue?


beers/commiserations
Justin



Re: Developing a browser (Firefox) extension with D

2009-11-18 Thread Frank Benoit
Justin Johansson schrieb:
 Hi Frank,
 
 Thanks for this very valuable information.  I was soon to post about D
 interoperability with JNI (Java Native Interface), but sounds like as
 you say D extensions for Java could also be problematic.  Okay if you
 are the only guy in there but big trouble if your extension is trying
 to co-exist with other vendor extensions in D.

There might be also a problem if firefox or something else in the same
process uses signals.

 
 I am left wondering though, is this a permanent show-stopper for the
 future (technically) or could something, at least in theory, be worked
 out to overcome the GC issue?

Perhaps start a child process and do inter process communication.
For one of my application I use a Java GUI and then I start a D process
and use stdin+stdout for JSON communication.



Re: Developing a browser (Firefox) extension with D

2009-11-18 Thread Jacob Carlborg

On 11/18/09 05:03, Justin Johansson wrote:

I'm just wondering for a moment if D might be a good vehicle for
developing a browser extension for Firefox, or any other browser for
that matter.

Has anyone either considered doing, or has actually done, any browser
extension development with D and have some thoughts or experience to share?

Thanks for all feedback,
Justin Johansson


I think someone tried to do (or did) an extension for internet explorer 
using DWT.


Developing a browser (Firefox) extension with D

2009-11-17 Thread Justin Johansson
I'm just wondering for a moment if D might be a good vehicle for 
developing a browser extension for Firefox, or any other browser for 
that matter.


Has anyone either considered doing, or has actually done, any browser 
extension development with D and have some thoughts or experience to share?


Thanks for all feedback,
Justin Johansson


Re: Developing a browser (Firefox) extension with D

2009-11-17 Thread Nick Sabalausky
Justin Johansson n...@spam.com wrote in message 
news:hdvrmr$215...@digitalmars.com...
 I'm just wondering for a moment if D might be a good vehicle for 
 developing a browser extension for Firefox, or any other browser for that 
 matter.

 Has anyone either considered doing, or has actually done, any browser 
 extension development with D and have some thoughts or experience to 
 share?

 Thanks for all feedback,
 Justin Johansson

I thought FF extensions were JS-only, is that not the case? 




Re: Developing a browser (Firefox) extension with D

2009-11-17 Thread Clay Smith

Nick Sabalausky wrote:
Justin Johansson n...@spam.com wrote in message 
news:hdvrmr$215...@digitalmars.com...
I'm just wondering for a moment if D might be a good vehicle for 
developing a browser extension for Firefox, or any other browser for that 
matter.


Has anyone either considered doing, or has actually done, any browser 
extension development with D and have some thoughts or experience to 
share?


Thanks for all feedback,
Justin Johansson


I thought FF extensions were JS-only, is that not the case? 





https://developer.mozilla.org/En/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System

C/C++ works, I imagine D could with some effort.


Re: Developing a browser (Firefox) extension with D

2009-11-17 Thread Justin Johansson

Nick Sabalausky wrote:
Justin Johansson n...@spam.com wrote in message 
news:hdvrmr$215...@digitalmars.com...
I'm just wondering for a moment if D might be a good vehicle for 
developing a browser extension for Firefox, or any other browser for that 
matter.


Has anyone either considered doing, or has actually done, any browser 
extension development with D and have some thoughts or experience to 
share?


Thanks for all feedback,
Justin Johansson


I thought FF extensions were JS-only, is that not the case? 


While extentions can be written/partly written in JS, the system level
for extensions is C++.  The FF code base is built on a single-threaded
COM model (similar in theory but definitely not binary compatible with 
Microsoft COM).  Think it's called NSCOM (as in Netscape).  Components 
(aka objects) are managed with the usual AddRef/Release and interfaces 
found with the familiar QueryInterface (familiar that is if you have 
ever used MS COM).  The basic interface of a component is NSIUnknown or 
similar.  The methods of the NSIUnknown interface are AddRef, Release 
and QueryInterface.  Such mechanism effectively implements a 
reference-counted garbage-collection strategy.


As with a lot of COM development (in C++), people often resort to the 
use of so-called smart-pointers to hide/manage calls to AddRef and 
Release.  So my guess/hunch is that if D is any good for writing MS COM 
applications, it might also be good for writing FF extensions.


If it could be demonstrated that D was a good platform for writing FF 
extensions, that might be a boon for expanding D's market acceptance.


Re: Developing a browser (Firefox) extension with D

2009-11-17 Thread Frank Benoit
Justin Johansson schrieb:
 I'm just wondering for a moment if D might be a good vehicle for
 developing a browser extension for Firefox, or any other browser for
 that matter.
 
 Has anyone either considered doing, or has actually done, any browser
 extension development with D and have some thoughts or experience to share?
 
 Thanks for all feedback,
 Justin Johansson

As an extension, there might be more than one extension running in one
Firefox process. Each extension written in D must bring in its own GC,
here comes the problem. The GC is implemented in D using signals, which
are global to the process. So if there are two D extensions, they will
get confused by each other. This is also the reason, i give up about
running D and Java in the same process. Also Java uses those signals for
its own GC.

But nevertheless, if you want to give it a try, the DWT firefox bindings
might be of interest for you.