On 1/4/2016 9:24 AM, 罗勇刚(Yonggang Luo) wrote:
1、I was not trying implement new things in xpcom, our company(Kingsoft) are
maintaining a fork of thunderbird, and at the current time
We have to re-use existing XPCOM components that already exists in the
thunderbid gecko world, beyond pure html
things, there is too much things we have to re-use(xpcom things), and we
are facing performance problems,
the mork-db and the mime-parse, they are all working in synchronous way, so
I have to figure out a way to calling these components
in a worker directly, so that they would not cause UI-lag in main-thread.
That's all the reason why I was trying to re-implement XPConnect with
js-ctypes. So that I can calling
the exist components in the worker. And free the main-thread.
Mork, by design, can't be used off main-thread. So even if you're trying
to subvert it by using JS-ctypes and etc., it's not going to work very
well, let alone the problems you have with trying to maintain a
pseudo-reimplementation of xpconnect.
3、 There is an advantage of XPCOM, WebIDL seems merely for Javascript, but
XPCOM seems more language-neutral, we could be able to
use xpcom in Java/Python and other languages, that's looks like a advantage
of XPCOM.
XPIDL is effectively a fork of an old version of IDL. Its interfaces are
incapable of cleanly representing union types or array types very well,
something that WebIDL does far better, as WebIDL is partly a fork of a
newer version of IDL. I believe there already exists WebIDL bindings for
C++, JS, and Rust, and extending it to Java or Python would not be a
challenging task. The only complexity is that the WebIDL bindings does
not use a grand-central dispatch mechanism like XPConnect, but that
merely means that adding new bindings requires writing a code generator
and feeding all the interfaces through it instead of implementing
several customized dispatch mechanisms. Not that PyXPCOM or JavaXPCOM
have worked for the past several years.
--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform