[lucy-user] Using Lucy directly from C

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[lucy-user] Using Lucy directly from C

Rayne Olivetti
I'm well aware of the purpose of Lucy, but is it not possible to use it directly from C? I can't find any documents regarding this, and the INSTALL file says "Currently it is available via Perl bindings.", which almost suggests "you're on your own if you're going to use Lucy from C" (and this sounds quite awkward for a C library).

I'm also trying to write Go bindings (which is normally done via cgo, which allows Go code to directly call C functions), and using cgo doesn't require any of the binding magics that ships with Lucy --it works best with a plain, old C API.
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

Nathan Kurz
On Thu, Nov 22, 2012 at 4:35 AM, Rayne Olivetti <[hidden email]> wrote:
> I'm well aware of the purpose of Lucy, but is it not possible to use it directly from C? I can't find any documents regarding this, and the INSTALL file says "Currently it is available via Perl bindings.", which almost suggests "you're on your own if you're going to use Lucy from C" (and this sounds quite awkward for a C library).
>
> I'm also trying to write Go bindings (which is normally done via cgo, which allows Go code to directly call C functions), and using cgo doesn't require any of the binding magics that ships with Lucy --it works best with a plain, old C API.

There is not yet a published C API.   There is a strong desire to have
one, but it's yet to be a top priority.  It will probably stay that
way until someone shows up on the mailing list with a clear need and
the willingness and ability to help work on it. :)

The difficulty is that host languages are integral to the way Lucy
works, and some small but crucial pieces are implemented only in the
host language.  There's been considerable interest in other languages,
but right now Perl is the only one fully supported.

Here's a little more background:
http://lucene.472066.n3.nabble.com/Release-date-and-language-bindings-td676033.html

--nate
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

Rayne Olivetti
The reason for me to seek a C/C++ alternative for Lucene very simple: performance (especially memory) and dependencies (no Java on many embedded systems).

This sounds like problem you need to solve anyway first, if you want people to write bindings for other languages.
Unless there is a complete C API, I personally would rather stick to swig bindings of clucene.

And it behooves me to say that Lucy is trying to solve other problems (a toy-swig project which you expect people to learn to use in order to wrap your one, single library) that it's rather supposed to solve in the first place.
Here's an excerpt from Lucy FAQ:

Why don't you use Swig?
A major design goal of Lucy is to present bindings which are as idiomatic as possible so that our users feel as though they are programming in their native language and not in C. Swig is a great tool, but it does not offer support for many of the features which make Lucy so user friendly: subclassing, named parameters, default argument values, etc.
These excuses downright wrong. Surely SWIG handles inheritance, default arguments, and named parameters (docstring features for python) for languages that support them. If your favorite, killer feature X is missing for your apparently-favorite-language Perl, why don't you just send a patch to Swig instead of re-inventing the wheel? And I should and add Swig is a BIG wheel.
And mind you, not many languages support those features.

And okay, I get that you love Perl, and you probably don't want to dig into the giant called Swig just to implement a single feature you like. But please understand that Perl is obsolete to many people today, and by not implementing a complete C API, you're not letting people to use Swig (or whatever tool the language X supports for wrapping C code) at their option.

Last but not least, "loose C port" implies it can be used via C, which led me to this project. In it's current form, Lucy mainly looks like a Perl port of Lucene, boosted with some C code.

Lucy is a project at it's infancy, so I expect many things to change in the future.
But for now, I'm going with clucene+swig.


----- Original Message -----
From: Nathan Kurz <[hidden email]>
To: [hidden email]; Rayne Olivetti <[hidden email]>
Cc:
Sent: Friday, November 23, 2012 2:33 AM
Subject: Re: [lucy-user] Using Lucy directly from C

On Thu, Nov 22, 2012 at 4:35 AM, Rayne Olivetti <[hidden email]> wrote:
> I'm well aware of the purpose of Lucy, but is it not possible to use it directly from C? I can't find any documents regarding this, and the INSTALL file says "Currently it is available via Perl bindings.", which almost suggests "you're on your own if you're going to use Lucy from C" (and this sounds quite awkward for a C library).
>
> I'm also trying to write Go bindings (which is normally done via cgo, which allows Go code to directly call C functions), and using cgo doesn't require any of the binding magics that ships with Lucy --it works best with a plain, old C API.

There is not yet a published C API.   There is a strong desire to have
one, but it's yet to be a top priority.  It will probably stay that
way until someone shows up on the mailing list with a clear need and
the willingness and ability to help work on it. :)

The difficulty is that host languages are integral to the way Lucy
works, and some small but crucial pieces are implemented only in the
host language.  There's been considerable interest in other languages,
but right now Perl is the only one fully supported.

Here's a little more background:
http://lucene.472066.n3.nabble.com/Release-date-and-language-bindings-td676033.html

--nate
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

Nathan Kurz
Sounds like Lucy is not the right fit for you.

Besides CLucene, you might also check out Hyperestraier:
http://fallabs.com/hyperestraier/index.html

Depending on your needs, the full-text search in SQLite might work
too: http://sqlite.org/fts3.html

--nate

On Sat, Nov 24, 2012 at 10:13 PM, Rayne Olivetti
<[hidden email]> wrote:

> The reason for me to seek a C/C++ alternative for Lucene very simple: performance (especially memory) and dependencies (no Java on many embedded systems).
>
> This sounds like problem you need to solve anyway first, if you want people to write bindings for other languages.
> Unless there is a complete C API, I personally would rather stick to swig bindings of clucene.
>
> And it behooves me to say that Lucy is trying to solve other problems (a toy-swig project which you expect people to learn to use in order to wrap your one, single library) that it's rather supposed to solve in the first place.
> Here's an excerpt from Lucy FAQ:
>
> Why don't you use Swig?
> A major design goal of Lucy is to present bindings which are as idiomatic as possible so that our users feel as though they are programming in their native language and not in C. Swig is a great tool, but it does not offer support for many of the features which make Lucy so user friendly: subclassing, named parameters, default argument values, etc.
> These excuses downright wrong. Surely SWIG handles inheritance, default arguments, and named parameters (docstring features for python) for languages that support them. If your favorite, killer feature X is missing for your apparently-favorite-language Perl, why don't you just send a patch to Swig instead of re-inventing the wheel? And I should and add Swig is a BIG wheel.
> And mind you, not many languages support those features.
>
> And okay, I get that you love Perl, and you probably don't want to dig into the giant called Swig just to implement a single feature you like. But please understand that Perl is obsolete to many people today, and by not implementing a complete C API, you're not letting people to use Swig (or whatever tool the language X supports for wrapping C code) at their option.
>
> Last but not least, "loose C port" implies it can be used via C, which led me to this project. In it's current form, Lucy mainly looks like a Perl port of Lucene, boosted with some C code.
>
> Lucy is a project at it's infancy, so I expect many things to change in the future.
> But for now, I'm going with clucene+swig.
>
>
> ----- Original Message -----
> From: Nathan Kurz <[hidden email]>
> To: [hidden email]; Rayne Olivetti <[hidden email]>
> Cc:
> Sent: Friday, November 23, 2012 2:33 AM
> Subject: Re: [lucy-user] Using Lucy directly from C
>
> On Thu, Nov 22, 2012 at 4:35 AM, Rayne Olivetti <[hidden email]> wrote:
>> I'm well aware of the purpose of Lucy, but is it not possible to use it directly from C? I can't find any documents regarding this, and the INSTALL file says "Currently it is available via Perl bindings.", which almost suggests "you're on your own if you're going to use Lucy from C" (and this sounds quite awkward for a C library).
>>
>> I'm also trying to write Go bindings (which is normally done via cgo, which allows Go code to directly call C functions), and using cgo doesn't require any of the binding magics that ships with Lucy --it works best with a plain, old C API.
>
> There is not yet a published C API.   There is a strong desire to have
> one, but it's yet to be a top priority.  It will probably stay that
> way until someone shows up on the mailing list with a clear need and
> the willingness and ability to help work on it. :)
>
> The difficulty is that host languages are integral to the way Lucy
> works, and some small but crucial pieces are implemented only in the
> host language.  There's been considerable interest in other languages,
> but right now Perl is the only one fully supported.
>
> Here's a little more background:
> http://lucene.472066.n3.nabble.com/Release-date-and-language-bindings-td676033.html
>
> --nate
fgl
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

fgl
<i>please understand that Perl is obsolete to many people today,</i>

No offence, and I also have no intention of getting into an argument, but
that's a rather naive, ignorant and arrogant statement...  Have you funded
a comprehensive study world-wide which led you to that confident statement?
  You clearly have no idea how much Perl code is out there.  It reminds me
of these snotty little kids fresh out of college who say the same things
about COBOL (which is alive and kicking, but probably way beyond your pay
scale or professional experience).    Thanks for the laugh, I needed it.

/me gets on with day feeling so much better having laughed hard enough to
loosen spine and tense shoulder muscles.
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

Marvin Humphrey
Hi,

I'd like to assure the Lucy community at large that the core developers take
notice both when people say inflammatory things and take the conversation in
an unproductive direction, and conversely, when people resist the temptation
to respond in kind, shutting down unproductive threads through restraint and
ruthless civility.

To quote Doug Cutting, Lucene founder and current Chair of the ASF Board,

    http://markmail.org/message/vze5xbbtg64ohmhf

    An important technique here is to respond to things you find offensive in
    a polite manner, or not at all.

Thanks to everyone who contributes to our long tradition of courtesy.  If you
want to get anything done around here, that's the way to go.

Marvin Humphrey

On Mon, Jan 28, 2013 at 7:38 AM, fgl <[hidden email]> wrote:

> <i>please understand that Perl is obsolete to many people today,</i>
>
> No offence, and I also have no intention of getting into an argument, but
> that's a rather naive, ignorant and arrogant statement...  Have you funded
> a comprehensive study world-wide which led you to that confident statement?
>   You clearly have no idea how much Perl code is out there.  It reminds me
> of these snotty little kids fresh out of college who say the same things
> about COBOL (which is alive and kicking, but probably way beyond your pay
> scale or professional experience).    Thanks for the laugh, I needed it.
>
> /me gets on with day feeling so much better having laughed hard enough to
> loosen spine and tense shoulder muscles.
fgl
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

fgl
To the original poster and the community at large:

I offer my unconditional apology for my unwarranted, impolite and downright
unproductive comment.

It was a moment of silliness, weakness and was really, really not
necessary.  It's the kind of comment one would NEVER make in polite
personal conversation.

Sorry once again.

Regards


On Mon, Jan 28, 2013 at 9:58 PM, Marvin Humphrey <[hidden email]>wrote:

> Hi,
>
> I'd like to assure the Lucy community at large that the core developers
> take
> notice both when people say inflammatory things and take the conversation
> in
> an unproductive direction, and conversely, when people resist the
> temptation
> to respond in kind, shutting down unproductive threads through restraint
> and
> ruthless civility.
>
> To quote Doug Cutting, Lucene founder and current Chair of the ASF Board,
>
>     http://markmail.org/message/vze5xbbtg64ohmhf
>
>     An important technique here is to respond to things you find offensive
> in
>     a polite manner, or not at all.
>
> Thanks to everyone who contributes to our long tradition of courtesy.  If
> you
> want to get anything done around here, that's the way to go.
>
> Marvin Humphrey
>
> On Mon, Jan 28, 2013 at 7:38 AM, fgl <[hidden email]> wrote:
> > <i>please understand that Perl is obsolete to many people today,</i>
> >
> > No offence, and I also have no intention of getting into an argument, but
> > that's a rather naive, ignorant and arrogant statement...  Have you
> funded
> > a comprehensive study world-wide which led you to that confident
> statement?
> >   You clearly have no idea how much Perl code is out there.  It reminds
> me
> > of these snotty little kids fresh out of college who say the same things
> > about COBOL (which is alive and kicking, but probably way beyond your pay
> > scale or professional experience).    Thanks for the laugh, I needed it.
> >
> > /me gets on with day feeling so much better having laughed hard enough to
> > loosen spine and tense shoulder muscles.
>
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-user] Using Lucy directly from C

Marvin Humphrey
On Mon, Jan 28, 2013 at 10:29 PM, fgl <[hidden email]> wrote:
> To the original poster and the community at large:

---->8 snip 8<----

Thanks for helping us all to move on. :)

Marvin Humphrey