Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-21 Thread Philip Chee
On 20/11/2015 19:51, Till Schneidereit wrote: > On Fri, Nov 20, 2015 at 12:23 PM, David Rajchenbach-Teller < > dtel...@mozilla.com> wrote: > >> It could be improved a bit, but the real issue is that JavaScript is a >> high-level, garbage-collected, dynamic programming language, while C is >> a

Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-20 Thread David Rajchenbach-Teller
It could be improved a bit, but the real issue is that JavaScript is a high-level, garbage-collected, dynamic programming language, while C is a low-level, memory-unsafe, type-unsafe, statically compiled programming language. I have heard a few ideas floating around on how this could be improved,

Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-20 Thread Philip Chee
On 18/11/2015 16:04, David Rajchenbach-Teller wrote: > Well, the main problem is that js-ctypes is very hard to use, even > harder to use without causing memory leaks or crashing the process. > Think the worst parts of both C and JavaScript together. Are these problems inherent in ctypes or is it

Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-18 Thread Philip Chee
On 14/11/2015 18:21, David Rajchenbach-Teller wrote: > Actually, Sqlite.jsm does most of its work off the main thread. > > But yes, it would clearly be possible to reimplement Sqlite.jsm using > js-ctypes for workers. If you wish to work on this, I can try and help > mentoring. I thought people

Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-18 Thread David Rajchenbach-Teller
Well, the main problem is that js-ctypes is very hard to use, even harder to use without causing memory leaks or crashing the process. Think the worst parts of both C and JavaScript together. Cheers, David On 18/11/15 08:57, Philip Chee wrote: > On 14/11/2015 18:21, David Rajchenbach-Teller

Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-14 Thread David Rajchenbach-Teller
Actually, Sqlite.jsm does most of its work off the main thread. But yes, it would clearly be possible to reimplement Sqlite.jsm using js-ctypes for workers. If you wish to work on this, I can try and help mentoring. Cheers, David On 14/11/15 10:45, Yonggang Luo wrote: > The current Sqlite.jsm

Re: Is that possible to implement Sqlite.jsm with ctypes so that is can works in the worker?

2015-11-14 Thread Yonggang Luo
On Saturday, November 14, 2015 at 6:21:34 PM UTC+8, David Rajchenbach-Teller wrote: > Actually, Sqlite.jsm does most of its work off the main thread. > > But yes, it would clearly be possible to reimplement Sqlite.jsm using > js-ctypes for workers. If you wish to work on this, I can try and help