SlideShare a Scribd company logo
1 of 88
Wine label from Perl
(located in Germany)
Thanks , Wendy and Liz!
... and MST
typemap in Perl/XS
Kenichi Ishigaki
(charsbar)
@OSDC.TW 2013
April 19, 2013
Let me ask you
first.
Have you ever written
an extension that
bridges C and Perl?
Part I: XS is ...?
Perl has a feature to load
an external C library.
use DynaLoader;
my @paths = dl_findfile(...);
my $lib = dl_load_file($path);
This won't work correctly
unless the library conforms
with Perl's convention.
use DynaLoader;
my @paths = dl_findfile(...);
my $lib = dl_load_file($path);
So we need something
in-between.
Perl XS C library
Writing the one-in-
between is fairly
easy.
(as long as you don't
add anything extra)
The simplest form of the one-
in-between starts like this:
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
These three lines are to use
Perl API.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
This is for portability
between perls.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
This is to import C functions
from the library.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
Module and package
declarations.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
The function declarations to
export (XSUBs) follow.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
As with .h files, there should
be only declarations.
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include <foo.h>
MODULE = Foo PACKAGE = Foo
int
func(const char* str)
Nothing difficult
(in principle).
The library you use
may not always be
that simple.
People may add
something written in C
with a variety of Perl
API.
If someone's XS
code scares you,
please remember.
What's difficult is
not the XS
interface itself.
It's something else
that makes the
matter
complicated.
Don't hesitate writing
XS interface if you
find a useful C
library.
Part II: How .xs file is compiled
To build an interface
library, we need to
turn its XS declaration
into pure C code.
If you already have
Makefile.PL, run it, and
then, make.
$ perl Makefile.PL && make
If you have Build.PL, do
something like this (or
maybe ./Build build).
$ perl Build.PL && ./Build
If you don't have either,
Milla or Minilla will help
you (ask miyagawa-san).
The most important XSUB part
will be translated like this:
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
A function exposed to the Perl world
takes a Perl variable as its argument.
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
However, a Perl variable is
actually a structure in C.
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
You can't pass it directly to a C
function, and vice versa.
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
The Perl variable is converted
and cast into a C value here.
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
Then, the function imported
from the library is called.
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
And the return value is converted
into a Perl value again.
XS_EUPXS(XS_Foo_func)
{
dVAR; dXSARGS;
if (items != 1)
croak_xs_usage(cv, "str");
{
int RETVAL;
dXSTARG;
const char* str = (const char *)SvPV_nolen(ST(0));
RETVAL = func(str);
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
typemap is the
key to this
conversion.
Basic type mappings
are defined in
ExtUtils::typemap.
$ perldoc -m ExtUtils::typemap
# basic C types
int T_IV
unsigned T_UV
unsigned int T_UV
long T_IV
unsigned long T_UV
short T_IV
unsigned short T_UV
char T_CHAR
unsigned char T_U_CHAR
char * T_PV
unsigned char * T_PV
const char * T_PV
caddr_t T_PV
wchar_t * T_PV
wchar_t T_IV
# bool_t is defined in <rpc/rpc.h>
bool_t T_IV
size_t T_UV
ssize_t T_IV
time_t T_NV
unsigned long * T_OPAQUEPTR
char ** T_PACKEDARRAY
void * T_PTR
Time_t * T_PV
SV * T_SV
Any type not listed there
should be added locally,
in a file named
"typemap".
Part III: On type mapping
A typical
"typemap" file has
three sections.
"TYPEMAP" section contains
a pair of C type and XS
type.
TYPEMAP
char * T_PV
How to map should be described
in the "INPUT" and "OUTPUT"
sections, if necessary.
INPUT
T_PV
$var = ($type)SvPV_nolen($arg)
OUTPUT
T_PV
sv_setpv((SV*)$arg, $var);
These code fragments will be
interpolated while processing
an XS file.
INPUT
T_PV
$var = ($type)SvPV_nolen($arg)
OUTPUT
T_PV
sv_setpv((SV*)$arg, $var);
Adding orphan C types
is easy.
TYPEMAP
my_id T_IV
my_str T_PV
Modifying the
behavior of an
existing type needs
some consideration.
If you are confident, just
add a new code fragment in
your local typemap.
INPUT
T_PV
if (!SvOK($arg)) {
$var = NULL;
} else {
$var = ($type)SvPV_nolen($arg);
}
Or, you might want to add another
typedef in the XS file, before
MODULE and PACKAGE declarations.
typedef char * my_nullable_str;
MODULE Foo PACKAGE FOO
int
func(my_nullable_str str)
And then, add a behavior of this
new type in your local typemap.
TYPEMAP
my_nullable_str T_PV_OR_NULL
INPUT
T_PV_OR_NULL
if (!SvOK($arg)) {
$var = NULL;
} else {
$var = ($type)SvPV_nolen($arg);
}
There is also a much
trickier way to do it.
MODULE Foo PACKAGE FOO
int
func(char * str_or_null)
If you don't get why this
works, see perlref.
INPUT
T_PV
$var = ${
$var =~ /_or_null$/
? qq{NULL}
: qq{($type)SvPV_nolen($arg)}
}
Remove a star and prepend
"OUT" (or "IN_OUT") for an
argument called by reference.
MODULE Foo PACKAGE FOO
int
func(char * str, OUT int len)
Further Reading
• perlxs
• perlxstut
• perlxstypemap
• perlapi
• perlcall
• ... and others' XS code :p
Part IV: From .h files
to XS files
We've written XS
files by hand so far.
Of course this can
be done with a tool.
The best-known
tool is h2xs.
It's mainly used to
expose constants
from a C library.
With the help of
C::Scan, you can use it
to expose C functions as
well.
$ h2xs -Axan Foo /path/to/header.h
Defaulting to backwards compatibility with perl 5.xx.x
If you intend this module to be compatible with
earlier perl versions, please specify a minimum perl
version with the -b option.
Writing Foo/ppport.h
Scanning typemaps...
Scanning /home/xxxx/perl5/perlbrew/perls/perl-
5.xx.x/lib/5.xx.x/ExtUtils/typemap
Scanning /path/to/header.h for functions...
Scanning /path/to/header.h for typedefs...
Writing Foo/lib/Foo.pm
Writing Foo/Foo.xs
Writing Foo/typemap
Writing Foo/Makefile.PL
Writing Foo/README
Writing Foo/t/Foo.t
Writing Foo/Changes
Writing Foo/MANIFEST
If the library is stable, this may
give you a good starting point.
However.
The files h2xs generates
are rather old-
fashioned.
It's not good at updating
only a part of a
distribution, either.
I started writing
Convert::H::XS.
https://github.com/charsbar/convert_h_xs
Convert::H::XS takes a C header file,
and looks for the minimum
information to write XS components.
use Convert::H::XS;
my $converter = Convert::H::XS->new;
$converter->process($h_file);
Convert::H::XS also provides
methods to write XS components
for convenience.
$converter->write_constants(
"xs/constants.inc",
);
You can tweak those
pieces of information
with a callback.
$converter->write_functions(
"xs/functions.inc",
sub {
my ($type, $name, $args) = @_;
...
return ($type, $name, $args);
});
Grateful if you help
me improve this at
the hackathon.
Part V: CPANTS
update
I talked about
CPANTS last year.
CPANTS tests what module
authors often forget to test
by themselves.
Perl QA Hackathon
2013 in Lancaster
Several metrics are
going to be removed.
Several metrics are
going to be added.
To add new metrics,
we need to find
issues.
Issues are often raised by
other QA/toolchain people.
• Do not ship modules with Module::Install 1.04
http://weblog.bulknews.net/post/33907905561/do-not-ship-modules-with-module-install-1-04
• stop shipping MYMETA to CPAN
http://weblog.bulknews.net/post/44251476706/stop-shipping-mymeta-to-cpan
We need to confirm
they are measurable,
and widespread.
What can I use to
confirm?
• CPANTS databases
• metacpan
• CPAN grep
I just wanted
something else.
Groonga
• a fulltext search engine
• a column store
• actively developed (monthly release)
• client/server (http/gqpt)
• C API
• Web interface
Groonga::API
https://github.com/charsbar/groonga-api
Also grateful if you
help me improve this
at the hackathon.
Thank you!

More Related Content

What's hot

Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)julien pauli
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides22021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2LiviaLiaoFontech
 
Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Elizabeth Smith
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in PerlLaurent Dami
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13julien pauli
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4Wim Godden
 
Php Extensions for Dummies
Php Extensions for DummiesPhp Extensions for Dummies
Php Extensions for DummiesElizabeth Smith
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPGuilherme Blanco
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlBruce Gray
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from insidejulien pauli
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlHideaki Ohno
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)Ontico
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPatrick Allaert
 
Handling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVMHandling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVMMin-Yih Hsu
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers ToolboxStefan
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7julien pauli
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and coPierre Joye
 

What's hot (20)

Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides22021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
 
Streams, sockets and filters oh my!
Streams, sockets and filters oh my!Streams, sockets and filters oh my!
Streams, sockets and filters oh my!
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
Php Extensions for Dummies
Php Extensions for DummiesPhp Extensions for Dummies
Php Extensions for Dummies
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line Perl
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from inside
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
 
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
HHVM: Efficient and Scalable PHP/Hack Execution / Guilherme Ottoni (Facebook)
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & Pinba
 
Handling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVMHandling inline assembly in Clang and LLVM
Handling inline assembly in Clang and LLVM
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
Profiling php5 to php7
Profiling php5 to php7Profiling php5 to php7
Profiling php5 to php7
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and co
 

Similar to typemap in Perl/XS

Getting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::CGetting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::Cdaoswald
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by ExampleOlve Maudal
 
Embed--Basic PERL XS
Embed--Basic PERL XSEmbed--Basic PERL XS
Embed--Basic PERL XSbyterock
 
The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...PVS-Studio
 
What we can learn from Rebol?
What we can learn from Rebol?What we can learn from Rebol?
What we can learn from Rebol?lichtkind
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxfaithxdunce63732
 
streams and files
 streams and files streams and files
streams and filesMariam Butt
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packagesAjay Ohri
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate WorksGoro Fuji
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchAndrew Lowe
 
Ekon bestof rtl_delphi
Ekon bestof rtl_delphiEkon bestof rtl_delphi
Ekon bestof rtl_delphiMax Kleiner
 
Bioinformatica 29-09-2011-p1-introduction
Bioinformatica 29-09-2011-p1-introductionBioinformatica 29-09-2011-p1-introduction
Bioinformatica 29-09-2011-p1-introductionProf. Wim Van Criekinge
 
Phyton Learning extracts
Phyton Learning extracts Phyton Learning extracts
Phyton Learning extracts Pavan Babu .G
 

Similar to typemap in Perl/XS (20)

Getting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::CGetting started with Perl XS and Inline::C
Getting started with Perl XS and Inline::C
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by Example
 
Embed--Basic PERL XS
Embed--Basic PERL XSEmbed--Basic PERL XS
Embed--Basic PERL XS
 
The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...
 
Perl Basics with Examples
Perl Basics with ExamplesPerl Basics with Examples
Perl Basics with Examples
 
What we can learn from Rebol?
What we can learn from Rebol?What we can learn from Rebol?
What we can learn from Rebol?
 
Perl Programming - 01 Basic Perl
Perl Programming - 01 Basic PerlPerl Programming - 01 Basic Perl
Perl Programming - 01 Basic Perl
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
 
Easy R
Easy REasy R
Easy R
 
streams and files
 streams and files streams and files
streams and files
 
Perl 20tips
Perl 20tipsPerl 20tips
Perl 20tips
 
r,rstats,r language,r packages
r,rstats,r language,r packagesr,rstats,r language,r packages
r,rstats,r language,r packages
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
C to perl binding
C to perl bindingC to perl binding
C to perl binding
 
Bioinformatics v2014 wim_vancriekinge
Bioinformatics v2014 wim_vancriekingeBioinformatics v2014 wim_vancriekinge
Bioinformatics v2014 wim_vancriekinge
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
Ekon bestof rtl_delphi
Ekon bestof rtl_delphiEkon bestof rtl_delphi
Ekon bestof rtl_delphi
 
Bioinformatica 29-09-2011-p1-introduction
Bioinformatica 29-09-2011-p1-introductionBioinformatica 29-09-2011-p1-introduction
Bioinformatica 29-09-2011-p1-introduction
 
Phyton Learning extracts
Phyton Learning extracts Phyton Learning extracts
Phyton Learning extracts
 

More from charsbar

Common boolean class_for_perl5
Common boolean class_for_perl5Common boolean class_for_perl5
Common boolean class_for_perl5charsbar
 
2018年夏のPerl5
2018年夏のPerl52018年夏のPerl5
2018年夏のPerl5charsbar
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁charsbar
 
2017年夏のPerl
2017年夏のPerl2017年夏のPerl
2017年夏のPerlcharsbar
 
2017年春のPerl
2017年春のPerl2017年春のPerl
2017年春のPerlcharsbar
 
Json(::PP) is a-changing
Json(::PP) is a-changingJson(::PP) is a-changing
Json(::PP) is a-changingcharsbar
 
JSON, JSON::PP, and more
JSON, JSON::PP, and moreJSON, JSON::PP, and more
JSON, JSON::PP, and morecharsbar
 
perl language update
perl language updateperl language update
perl language updatecharsbar
 
CPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したいCPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したいcharsbar
 
2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情charsbar
 
Analyze CPAN, Analyze Community
Analyze CPAN, Analyze CommunityAnalyze CPAN, Analyze Community
Analyze CPAN, Analyze Communitycharsbar
 
Annual Report 2012
Annual Report 2012Annual Report 2012
Annual Report 2012charsbar
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLitecharsbar
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolscharsbar
 
CPANTS 2012
CPANTS 2012CPANTS 2012
CPANTS 2012charsbar
 
Revisiting ppm
Revisiting ppmRevisiting ppm
Revisiting ppmcharsbar
 
Mojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみようMojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみようcharsbar
 
変数、リファレンス
変数、リファレンス変数、リファレンス
変数、リファレンスcharsbar
 
關於perl的 文件翻譯
關於perl的文件翻譯關於perl的文件翻譯
關於perl的 文件翻譯charsbar
 
Practical Bug Reporting
Practical Bug ReportingPractical Bug Reporting
Practical Bug Reportingcharsbar
 

More from charsbar (20)

Common boolean class_for_perl5
Common boolean class_for_perl5Common boolean class_for_perl5
Common boolean class_for_perl5
 
2018年夏のPerl5
2018年夏のPerl52018年夏のPerl5
2018年夏のPerl5
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁
 
2017年夏のPerl
2017年夏のPerl2017年夏のPerl
2017年夏のPerl
 
2017年春のPerl
2017年春のPerl2017年春のPerl
2017年春のPerl
 
Json(::PP) is a-changing
Json(::PP) is a-changingJson(::PP) is a-changing
Json(::PP) is a-changing
 
JSON, JSON::PP, and more
JSON, JSON::PP, and moreJSON, JSON::PP, and more
JSON, JSON::PP, and more
 
perl language update
perl language updateperl language update
perl language update
 
CPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したいCPANの依存モジュールをもう少し正しく検出したい
CPANの依存モジュールをもう少し正しく検出したい
 
2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情2013年のCPANモジュール作成事情
2013年のCPANモジュール作成事情
 
Analyze CPAN, Analyze Community
Analyze CPAN, Analyze CommunityAnalyze CPAN, Analyze Community
Analyze CPAN, Analyze Community
 
Annual Report 2012
Annual Report 2012Annual Report 2012
Annual Report 2012
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLite
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
CPANTS 2012
CPANTS 2012CPANTS 2012
CPANTS 2012
 
Revisiting ppm
Revisiting ppmRevisiting ppm
Revisiting ppm
 
Mojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみようMojolicious::Liteを使ってみよう
Mojolicious::Liteを使ってみよう
 
変数、リファレンス
変数、リファレンス変数、リファレンス
変数、リファレンス
 
關於perl的 文件翻譯
關於perl的文件翻譯關於perl的文件翻譯
關於perl的 文件翻譯
 
Practical Bug Reporting
Practical Bug ReportingPractical Bug Reporting
Practical Bug Reporting
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

typemap in Perl/XS

  • 1. Wine label from Perl (located in Germany) Thanks , Wendy and Liz!
  • 3. typemap in Perl/XS Kenichi Ishigaki (charsbar) @OSDC.TW 2013 April 19, 2013
  • 4. Let me ask you first.
  • 5. Have you ever written an extension that bridges C and Perl?
  • 6. Part I: XS is ...?
  • 7. Perl has a feature to load an external C library. use DynaLoader; my @paths = dl_findfile(...); my $lib = dl_load_file($path);
  • 8. This won't work correctly unless the library conforms with Perl's convention. use DynaLoader; my @paths = dl_findfile(...); my $lib = dl_load_file($path);
  • 9. So we need something in-between. Perl XS C library
  • 10. Writing the one-in- between is fairly easy.
  • 11. (as long as you don't add anything extra)
  • 12. The simplest form of the one- in-between starts like this: #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 13. These three lines are to use Perl API. #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 14. This is for portability between perls. #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 15. This is to import C functions from the library. #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 16. Module and package declarations. #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 17. The function declarations to export (XSUBs) follow. #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 18. As with .h files, there should be only declarations. #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include <foo.h> MODULE = Foo PACKAGE = Foo int func(const char* str)
  • 20. The library you use may not always be that simple.
  • 21. People may add something written in C with a variety of Perl API.
  • 22. If someone's XS code scares you, please remember.
  • 23. What's difficult is not the XS interface itself.
  • 24. It's something else that makes the matter complicated.
  • 25. Don't hesitate writing XS interface if you find a useful C library.
  • 26. Part II: How .xs file is compiled
  • 27. To build an interface library, we need to turn its XS declaration into pure C code.
  • 28. If you already have Makefile.PL, run it, and then, make. $ perl Makefile.PL && make
  • 29. If you have Build.PL, do something like this (or maybe ./Build build). $ perl Build.PL && ./Build
  • 30. If you don't have either, Milla or Minilla will help you (ask miyagawa-san).
  • 31. The most important XSUB part will be translated like this: XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 32. A function exposed to the Perl world takes a Perl variable as its argument. XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 33. However, a Perl variable is actually a structure in C. XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 34. You can't pass it directly to a C function, and vice versa. XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 35. The Perl variable is converted and cast into a C value here. XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 36. Then, the function imported from the library is called. XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 37. And the return value is converted into a Perl value again. XS_EUPXS(XS_Foo_func) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "str"); { int RETVAL; dXSTARG; const char* str = (const char *)SvPV_nolen(ST(0)); RETVAL = func(str); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); }
  • 38. typemap is the key to this conversion.
  • 39. Basic type mappings are defined in ExtUtils::typemap. $ perldoc -m ExtUtils::typemap
  • 40. # basic C types int T_IV unsigned T_UV unsigned int T_UV long T_IV unsigned long T_UV short T_IV unsigned short T_UV char T_CHAR unsigned char T_U_CHAR char * T_PV unsigned char * T_PV const char * T_PV caddr_t T_PV wchar_t * T_PV wchar_t T_IV
  • 41. # bool_t is defined in <rpc/rpc.h> bool_t T_IV size_t T_UV ssize_t T_IV time_t T_NV unsigned long * T_OPAQUEPTR char ** T_PACKEDARRAY void * T_PTR Time_t * T_PV SV * T_SV
  • 42. Any type not listed there should be added locally, in a file named "typemap".
  • 43. Part III: On type mapping
  • 44. A typical "typemap" file has three sections.
  • 45. "TYPEMAP" section contains a pair of C type and XS type. TYPEMAP char * T_PV
  • 46. How to map should be described in the "INPUT" and "OUTPUT" sections, if necessary. INPUT T_PV $var = ($type)SvPV_nolen($arg) OUTPUT T_PV sv_setpv((SV*)$arg, $var);
  • 47. These code fragments will be interpolated while processing an XS file. INPUT T_PV $var = ($type)SvPV_nolen($arg) OUTPUT T_PV sv_setpv((SV*)$arg, $var);
  • 48. Adding orphan C types is easy. TYPEMAP my_id T_IV my_str T_PV
  • 49. Modifying the behavior of an existing type needs some consideration.
  • 50. If you are confident, just add a new code fragment in your local typemap. INPUT T_PV if (!SvOK($arg)) { $var = NULL; } else { $var = ($type)SvPV_nolen($arg); }
  • 51. Or, you might want to add another typedef in the XS file, before MODULE and PACKAGE declarations. typedef char * my_nullable_str; MODULE Foo PACKAGE FOO int func(my_nullable_str str)
  • 52. And then, add a behavior of this new type in your local typemap. TYPEMAP my_nullable_str T_PV_OR_NULL INPUT T_PV_OR_NULL if (!SvOK($arg)) { $var = NULL; } else { $var = ($type)SvPV_nolen($arg); }
  • 53. There is also a much trickier way to do it. MODULE Foo PACKAGE FOO int func(char * str_or_null)
  • 54. If you don't get why this works, see perlref. INPUT T_PV $var = ${ $var =~ /_or_null$/ ? qq{NULL} : qq{($type)SvPV_nolen($arg)} }
  • 55. Remove a star and prepend "OUT" (or "IN_OUT") for an argument called by reference. MODULE Foo PACKAGE FOO int func(char * str, OUT int len)
  • 56. Further Reading • perlxs • perlxstut • perlxstypemap • perlapi • perlcall • ... and others' XS code :p
  • 57. Part IV: From .h files to XS files
  • 58. We've written XS files by hand so far.
  • 59. Of course this can be done with a tool.
  • 61. It's mainly used to expose constants from a C library.
  • 62. With the help of C::Scan, you can use it to expose C functions as well. $ h2xs -Axan Foo /path/to/header.h
  • 63. Defaulting to backwards compatibility with perl 5.xx.x If you intend this module to be compatible with earlier perl versions, please specify a minimum perl version with the -b option. Writing Foo/ppport.h Scanning typemaps... Scanning /home/xxxx/perl5/perlbrew/perls/perl- 5.xx.x/lib/5.xx.x/ExtUtils/typemap Scanning /path/to/header.h for functions... Scanning /path/to/header.h for typedefs... Writing Foo/lib/Foo.pm Writing Foo/Foo.xs Writing Foo/typemap Writing Foo/Makefile.PL Writing Foo/README Writing Foo/t/Foo.t Writing Foo/Changes Writing Foo/MANIFEST
  • 64. If the library is stable, this may give you a good starting point.
  • 66. The files h2xs generates are rather old- fashioned.
  • 67. It's not good at updating only a part of a distribution, either.
  • 69. Convert::H::XS takes a C header file, and looks for the minimum information to write XS components. use Convert::H::XS; my $converter = Convert::H::XS->new; $converter->process($h_file);
  • 70. Convert::H::XS also provides methods to write XS components for convenience. $converter->write_constants( "xs/constants.inc", );
  • 71. You can tweak those pieces of information with a callback. $converter->write_functions( "xs/functions.inc", sub { my ($type, $name, $args) = @_; ... return ($type, $name, $args); });
  • 72. Grateful if you help me improve this at the hackathon.
  • 74. I talked about CPANTS last year.
  • 75. CPANTS tests what module authors often forget to test by themselves.
  • 76. Perl QA Hackathon 2013 in Lancaster
  • 77. Several metrics are going to be removed.
  • 79. To add new metrics, we need to find issues.
  • 80. Issues are often raised by other QA/toolchain people. • Do not ship modules with Module::Install 1.04 http://weblog.bulknews.net/post/33907905561/do-not-ship-modules-with-module-install-1-04 • stop shipping MYMETA to CPAN http://weblog.bulknews.net/post/44251476706/stop-shipping-mymeta-to-cpan
  • 81. We need to confirm they are measurable, and widespread.
  • 82. What can I use to confirm?
  • 83. • CPANTS databases • metacpan • CPAN grep
  • 85. Groonga • a fulltext search engine • a column store • actively developed (monthly release) • client/server (http/gqpt) • C API • Web interface
  • 87. Also grateful if you help me improve this at the hackathon.

Editor's Notes

  1. # and of course, it usually doesn&apos;t.
  2. # As you see, it&apos;s almost the same as declared in the .h files.
  3. # so that a C compiler can compile.
  4. # and should be.
  5. # information on defines, includes, functions, typedefs, structs etc is stored in $converter&apos;s stash.