On Sun, Oct 29, 2017 at 12:48 PM, Sebastián Gurin <sebastigu...@gmail.com> wrote:
> I wonder if somebody tried to compile lucy to JavaScript with > http://emscripten.org (C/C++ to JavaScript compiler). I am not aware of such an effort. > Also I wonder if the clownfish thing won't > make it difficult to perform such translation. So, before I tried, I > would like to know your thoughts. Clownfish would probably take some effort to adapt for this purpose. If I were to take on this task (and I did not want to spend the effort to familiarize myself with Clownfish first), I'd treat it like a loose port: create an empty directory alongside Lucy and flesh out new .c and .h files bit by bit, selecting out pieces to copy or munge, always maintaining optimum emscripten target output. Start by having an Indexer commit a Snapshot. Then add a DocWriter which does variable length records of key-value pairs. Next, create an IndexReader module which delegates to a DocReader module to fetch documents from the store. You can leave the inverted indexing modules and locking code for later, because the fundamental data structures and decomposition strategies of Lucy are sound. The result wouldn't really be Lucy, and wouldn't be immediately contributable to Lucy. Instead, it would have the same relation to Lucy as Lucy had to the original Lucene when it was ported. As the exercise moves on and you become more familiar with Lucy's problem domain and its implementation choices, you can decide what direction you want to take. Marvin Humphrey