You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Norman Barker <no...@gmail.com> on 2011/11/29 03:08:47 UTC

[lucy-dev] language bindings

Hi,

I am interested in writing an erlang language binding for lucy, I have
looked at the example-lang folder and then the tcl folder, does the
tcl folder follow the guidelines in example-lang (it doesn't seem to),
I don't mind if not, what is the recommendation, to write a simple
custom interface or to follow example-lang? Should I try and fill in
all the required stubs within the example-lang or can I just do a
subset and be ok?

The build system was straight forward, using perl was no issue for me,
is there a runtime dependencies on perl, or is it enough to have
lucy.so - /lucy/trunk/perl/blib/arch/auto/Lucy/Lucy.so, I did check
dependencies and it only seems to depend on libc.so but if it needs
more that would be a show stopper for me.

Ideally I would like to code in c/c++ in the core and then add a very
simple interface for adding documents to index and a search interface
to query but this seems to be against example-lang.

Any guidelines appreciated.

Many thanks,

Norman

Re: [lucy-dev] language bindings

Posted by Norman Barker <no...@gmail.com>.
Peter,

I am interested in helping with the C API, Marvin guessed correctly
that I am interested in wrapping this with Erlang to make it available
within CouchDB. The easiest and safest way for erlang to integrate
with C is to create an executable that sits in a while loop reading
and writing over stdio, the executable is managed by erlang, restarted
as necessary, so I would also be interested in implementing a command
line syntax (similar to Lucy::Simple) as an example of the C API. This
would enable integration with Erlang.

I will dig some more into the code and come back.

thanks,

Norman

On Tue, Nov 29, 2011 at 7:45 PM, Peter Karman <pe...@peknet.com> wrote:
> Marvin Humphrey wrote on 11/29/11 7:16 PM:
>> On Mon, Nov 28, 2011 at 07:08:47PM -0700, Norman Barker wrote:
>
> [snip]
>
>>
>>> Ideally I would like to code in c/c++ in the core and then add a very
>>> simple interface for adding documents to index and a search interface
>>> to query but this seems to be against example-lang.
>>>
>>> Any guidelines appreciated.
>>
>> I think the best way to achieve your goals is to team up with Peter Karman in
>> his drive to make Lucy available as a standalone C library.
>>
>
> Hi Norman,
>
> I've just started on the C implementation. My next task is to start porting the
> Perl unit tests to C as a concrete way of thinking about how the C user API is
> going to work. I would welcome your input and help on this front.
>
> Right now the c/ dir in trunk just has a basic autoconf setup in place, mostly
> as proof-of-concept (i.e. I'm not married to how it's implemented so far).
>
> Let me know if you'd like to pitch in in this area. I am often on irc at
> freenode in #lucy_dev (nick: karpet) if you find real-time chat more helpful.
> Otherwise, this list is the best place to start asking questions.
>
> cheers,
> pek
>
> --
> Peter Karman  .  http://peknet.com/  .  peter@peknet.com
>

Re: [lucy-dev] language bindings

Posted by Peter Karman <pe...@peknet.com>.
Marvin Humphrey wrote on 11/29/11 7:16 PM:
> On Mon, Nov 28, 2011 at 07:08:47PM -0700, Norman Barker wrote:

[snip]

> 
>> Ideally I would like to code in c/c++ in the core and then add a very
>> simple interface for adding documents to index and a search interface
>> to query but this seems to be against example-lang.
>>
>> Any guidelines appreciated.
> 
> I think the best way to achieve your goals is to team up with Peter Karman in
> his drive to make Lucy available as a standalone C library.
> 

Hi Norman,

I've just started on the C implementation. My next task is to start porting the
Perl unit tests to C as a concrete way of thinking about how the C user API is
going to work. I would welcome your input and help on this front.

Right now the c/ dir in trunk just has a basic autoconf setup in place, mostly
as proof-of-concept (i.e. I'm not married to how it's implemented so far).

Let me know if you'd like to pitch in in this area. I am often on irc at
freenode in #lucy_dev (nick: karpet) if you find real-time chat more helpful.
Otherwise, this list is the best place to start asking questions.

cheers,
pek

-- 
Peter Karman  .  http://peknet.com/  .  peter@peknet.com

Re: [lucy-dev] language bindings

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Mon, Nov 28, 2011 at 07:08:47PM -0700, Norman Barker wrote:
> I am interested in writing an erlang language binding for lucy,

Hello and welcome, Norman. :)

> I have looked at the example-lang folder and then the tcl folder, does the
> tcl folder follow the guidelines in example-lang (it doesn't seem to),

The tcl folder should not be used as a template.

> I don't mind if not, what is the recommendation, to write a simple
> custom interface or to follow example-lang? Should I try and fill in
> all the required stubs within the example-lang or can I just do a
> subset and be ok?

To write a full binding for Erlang, you would need to flesh out all the stubs
in example-lang, then do a lot more besides.  However, it doesn't seem that
you need a full binding.

> The build system was straight forward, using perl was no issue for me,
> is there a runtime dependencies on perl, or is it enough to have
> lucy.so - /lucy/trunk/perl/blib/arch/auto/Lucy/Lucy.so, I did check
> dependencies and it only seems to depend on libc.so but if it needs
> more that would be a show stopper for me.

That shared object is definitely Perl-specific. 

Historically, the code base that is now Apache Lucy began life as a pure-Perl
search engine library and has been slowly evolving towards C.  The
metamorphosis is not yet complete, and at present, Lucy can still only be used
from Perl.

> Ideally I would like to code in c/c++ in the core and then add a very
> simple interface for adding documents to index and a search interface
> to query but this seems to be against example-lang.
> 
> Any guidelines appreciated.

I think the best way to achieve your goals is to team up with Peter Karman in
his drive to make Lucy available as a standalone C library.

It sounds like making the full Lucy public API available from Erlang, so that
Erlang users enjoy as much flexibility and power as Perl users do today, is
not your ambition.  Instead, you want to enable Lucy for a very limited use
case within an Erlang environment.  (I speculate that your interest is
CouchDB-related.)  If Lucy had a C API, you could write the Lucy-specific
portion of the app in C and then provide only bridge code custom tailored to
the needs of the app.

Marvin Humphrey