You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Marvin Humphrey <ma...@rectangular.com> on 2012/09/22 00:13:44 UTC

[lucy-dev] Separating Clownfish and CFC

Greets,

I believe that we need to separate Clownfish and CFC into different
directories and build them as distinct CPAN/etc modules.

*   `Clownfish::CFC` is a compiler written in C.  It has no prerequisites
    aside from the host language.
*   `Clownfish` is the Clownfish core (Hash, CharBuf, VTable, Method, etc.).
    It depends on `Clownfish::CFC`.

I've prepared a branch on Github that illustrates the layout:

    https://github.com/rectang/lucy/tree/cfish_core/clownfish

*   All content in $REPOS/clownfish/ moves down one directory into
    $REPOS/clownfish/cfc/.  (Alternately, it could move sideways into
    $REPOS/cfc/.)
*   The new directories $REPOS/clownfish/core and $REPOS/clownfish/perl
    consist of selected content extracted and adapted from $REPOS/core/ and
    $REPOS/perl/.

There's plenty more work to do -- such as duping test files -- but what's
there now should be enough to serve as a proof-of-concept.

The plan here is to copy the Clownfish core, work on it until it builds on its
own, then integrate it into the Lucy core and once that's complete, delete the
originals from the Lucy core.

There's not much that's new here except for the disruption of moving CFC's
files around.  If we were already on Git I would have just committed these
changes into a feature branch within our own repository, but Github will do
for now.

PS: I'm going to try a Github pull request for this feature branch as an
experiment.  I think the notification will go to infrastructure-dev@a.o and
then we'll set up forwarding.

Marvin Humphrey

Re: [lucy-dev] Separating Clownfish and CFC

Posted by Nathan Kurz <na...@verse.com>.
On Fri, Sep 21, 2012 at 3:13 PM, Marvin Humphrey <ma...@rectangular.com> wrote:
> I believe that we need to separate Clownfish and CFC into different
> directories and build them as distinct CPAN/etc modules.

Agree.

> *   `Clownfish::CFC` is a compiler written in C.  It has no prerequisites
>     aside from the host language.

Glanced at the Git hierarchy, and not sure I'm understanding your
naming scheme.  Clownfish::CFC is a very Perlish name, and does not
sound like something that is done in C.  I think this will scare off
potential users.

"cfish" of "cfc" by contrast help to say that it's a compiled executable.

Also, will CFCPerl.c remain part of the compiler, or can it be moved
to somewhere Perl specific?  It feels like it should be an optional
loadable module rather than built in.  Or will it be selected for at
compile time?

> *   `Clownfish` is the Clownfish core (Hash, CharBuf, VTable, Method, etc.).
.
Even here I'm a bit confused.    "Clownfish" would be a good CPAN
name, but odd for what is essentially a C library.  Why not something
more C-ish like "libclownfish" or "libcfish"?

Or is this library already specific to Perl?  I was thinking there
would be another layer, perhaps a "lib-p5-clownfish.so" wrapper that
incorporates a host-language-free "libclownfish.a".   But I'm not
thinking that clearly.

>     It depends on `Clownfish::CFC`

Do you mean there is a linked-symbol dependency, or just that it's not
likely to of much use without first running the compliler?

I'm not too concerned about the exact names, but think we do want to
combat any sense that Lucy is Lucene-lite for Perl.    Even as a great
fan of Perl, I feel that there are enough Perl haters that it's a
heritage that we don't want to lead off with.  The "loose C"
definition is great.

--nate

Re: [lucy-dev] Separating Clownfish and CFC

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Sat, Sep 22, 2012 at 1:05 AM, Moritz Lenz <mo...@faui2k3.org> wrote:
> Separating them as clownfish/compiler and clownfish/runtime

+1, that's a sensible suggestion and it works for me.

> (I have no idea what CFC stands for, and I'm sure other newcomers will be in
> the same situation).

You're not yet afflicted by "The Curse of Knowledge". :)

    And that brings us to the villain of our book: The Curse of Knowledge.
    Lots of research in economics and psychology shows that when we know
    something, it becomes hard for us to imagine not knowing it.  As a result,
    we become lousy communicators.  Think of a lawyer who can't give you a
    straight, comprehensible answer to a legal question.  His vast knowledge
    and experience renders him unable to fathom how little you know.  So when
    he talks to you, he talks in abstractions that you can't follow.  And
    we're all like the lawyer in our own domain of expertise.

    Here's the great cruelty of the Curse of Knowledge: The better we get at
    generating great ideas -- new insights and novel solutions -- in our field
    of expertise, the more unnatural it becomes for us to communicate those
    ideas clearly.  That's why knowledge is a curse.  But notice we said
    "unnatural," not "impossible."

    Chip Heath and Dan Heath, "Made to Stick: Why Some Ideas Survive
and Others Die"

For the record, "CFC" stands for "chlorofluorocarbon".

(: And "ClownFish Compiler". :)

Marvin Humphrey

Re: [lucy-dev] Separating Clownfish and CFC

Posted by Moritz Lenz <mo...@faui2k3.org>.
On 09/22/2012 12:13 AM, Marvin Humphrey wrote:
> I believe that we need to separate Clownfish and CFC into different
> directories and build them as distinct CPAN/etc modules.
> 
> *   `Clownfish::CFC` is a compiler written in C.  It has no prerequisites
>     aside from the host language.
> *   `Clownfish` is the Clownfish core (Hash, CharBuf, VTable, Method, etc.).
>     It depends on `Clownfish::CFC`.

Just a small bit of terminology: it sounds that what you call Clownfish
is the runtime component, and Clownfish::CFC is the compiler.

Separating them as clownfish/compiler and clownfish/runtime might be
clearer than Clowfish and Clownfisch::CFC (I have no idea what CFC
stands for, and I'm sure other newcomers will be in the same situation).

Cheers,
Moritz

Re: [lucy-dev] Separating Clownfish and CFC

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Fri, Sep 21, 2012 at 10:27 PM, Logan Bell <lo...@gmail.com> wrote:
> You mention there is work to be done with duplicating test files, could you
> give an example as to which tests need to be ported or duplicated?

To migrate the core tests for Hash, we would perform the following copy
operations:

  $REPOS/core/Lucy/Test/Object/TestHash.cfh
    => $REPOS/clownfish/runtime/core/Clownfish/Test/TestHash.cfh
  $REPOS/core/Lucy/Test/Object/TestHash.c
    => $REPOS/clownfish/runtime/core/Clownfish/Test/TestHash.c
  $REPOS/perl/t/core/017-hash.t
    => $REPOS/clownfish/runtime/perl/t/core/017-hash.t

There are a number of support files that would have to migrate as well, so
that won't be enough, but it should give you an idea about what happens next.

Marvin Humphrey

Re: [lucy-dev] Separating Clownfish and CFC

Posted by Logan Bell <lo...@gmail.com>.
I took a gander at the below branch and I I like the idea. However, as I
was browsing through the new tree layout there were some thoughts/questions
that came to mind.

I guess I'm not clear as to what the difference is between ./clownfish/perl
and ./clownfish/cfc/perl. I'm seeing binding code in both paths, or at
least what I believe is binding code. With this current layout does that
mean there would be eventually a ./clownfish/ruby or is the perl directory
just an artifact of the current Perl porting effort? I'm guessing after
reading through your e-mail again that code in the cfc directory is only
compiler specific?

You mention there is work to be done with duplicating test files, could you
give an example as to which tests need to be ported or duplicated?

I'm also thrilled to see Lucy being forked on github!

Thanks,
Logan


On Fri, Sep 21, 2012 at 3:13 PM, Marvin Humphrey <ma...@rectangular.com>wrote:

> Greets,
>
> I believe that we need to separate Clownfish and CFC into different
> directories and build them as distinct CPAN/etc modules.
>
> *   `Clownfish::CFC` is a compiler written in C.  It has no prerequisites
>     aside from the host language.
> *   `Clownfish` is the Clownfish core (Hash, CharBuf, VTable, Method,
> etc.).
>     It depends on `Clownfish::CFC`.
>
> I've prepared a branch on Github that illustrates the layout:
>
>     https://github.com/rectang/lucy/tree/cfish_core/clownfish
>
> *   All content in $REPOS/clownfish/ moves down one directory into
>     $REPOS/clownfish/cfc/.  (Alternately, it could move sideways into
>     $REPOS/cfc/.)
> *   The new directories $REPOS/clownfish/core and $REPOS/clownfish/perl
>     consist of selected content extracted and adapted from $REPOS/core/ and
>     $REPOS/perl/.
>
> There's plenty more work to do -- such as duping test files -- but what's
> there now should be enough to serve as a proof-of-concept.
>
> The plan here is to copy the Clownfish core, work on it until it builds on
> its
> own, then integrate it into the Lucy core and once that's complete, delete
> the
> originals from the Lucy core.
>
> There's not much that's new here except for the disruption of moving CFC's
> files around.  If we were already on Git I would have just committed these
> changes into a feature branch within our own repository, but Github will do
> for now.
>
> PS: I'm going to try a Github pull request for this feature branch as an
> experiment.  I think the notification will go to infrastructure-dev@a.oand
> then we'll set up forwarding.
>
> Marvin Humphrey
>