On Tue, Nov 6, 2012 at 11:03 PM, Logan Bell <[email protected]> wrote:
> So, with that, correct me if I'm wrong, but it sounds like the
> immediate next steps (outside of the charmonizer issue) is the
> following:
>
> 1. Create a CFCRubyType.h/c with the associated functions
> CFCRubyTypeMap_from_ruby/CFCRubyTypeMap_to_ruby
Sounds good.
> 2. Map these in the CFC.c file in compiler/ruby/ext/Clownfish
We aren't necessarily going to need to access these from Ruby, so I wouldn't
bother just yet.
The functions `CFCPerlTypeMap_to_perl` and `CFCPerlTypeMap_from_perl` are only
used in CFCPerlMethod.c and CFCPerlClass.c. The analogous `to_ruby` and
`from_ruby` functions will presumably end up being used in the future files
"CFCRubyMethod.c" and "CFCRubyClass.c".
> After these steps, again referring back to
> Clownfish::CFC::Perl::Build, it calls out to the binding object the
> following methods: write_boot and write_bindings. I'm imagining, this
> would be where the real work will begin by creating CFCRuby.c to
> implement these calls.
Yes.
> So if I'm correct the first step is to start
> fashioning write_boot, which I believe is the boot strapping code for
> clownfish?
Conceptually, it writes the code that must be run when the XS module is
loaded (wrapped up in a function named `lucy_Lucy_bootstrap`):
MODULE = Lucy PACKAGE = Lucy
BOOT:
lucy_Lucy_bootstrap();
Run the following commands:
cd $REPOS/perl/
perl Build.PL
./Build clownfish
Then look at these files, which are what gets written by `write_boot()`
autogen/include/lucy_boot.h
autogen/source/lucy_boot.c
I think for starters it would be OK if the boot.c file you're generating more
or less looks like this:
#include "lucy_boot.h"
#include "parcel.h"
void
lucy_Lucy_bootstrap() {
lucy_bootstrap_parcel();
}
Marvin Humphrey