On Sun, Jul 6, 2014 at 4:13 PM, Nick Wellnhofer <[email protected]> wrote:
> there are two things I’d like to change about the Clownfish bootstrapping 
> process.
>
> 1. Clownfish projects currently have to provide a bit of XS boilerplate to
>    call the generated bootstrap function. For example, have a look at my
>    example C extension:
>
>    
> https://github.com/nwellnhof/LucyX-Analysis-WhitespaceTokenizer/blob/master/perl/buildlib/Binding.pm
>
> I’d like to generate that automatically.

+1

Clownfish needs a "clownfish-starter" script which generates a boilerplate
project layout.  (Unix-only would be fine, probably Perl or sh.)  Convention
over configuration and all that.

Presumably running `clownfish-starter --perl` would generate that XS
boilerplate.

A Clownfish tutorial would involve running this script as a first step.

> 2. A second initialization function called _init_autobindings() has to be 
> called manually from Perl:
>
> https://github.com/nwellnhof/LucyX-Analysis-WhitespaceTokenizer/blob/master/perl/lib/LucyX/Analysis/WhitespaceTokenizer.pm
>
> Is there any reason for a separate function? Couldn’t it be rolled into the
> bootstrap code directly?

Yes, _init_autobindings can be rolled into the bootstrapping.  The historical
reason for that function was to load an autogenerated .pm file containing Perl
hashes which were used for param checking.  Nowadays param checking is built
into the generated XS.

Marvin Humphrey

Reply via email to