We have received the following grant application "Inline::C(PP) Module Support". Please leave feedback in the comments field by September 25th, 2014.
Inline::C(PP) Module Support
- Ingy döt Net
- David Oswald
Make Inline::C and Inline::CPP the best choice for writing "XS" modules.
Benefits to the Perl Community
In 2000, Inline.pm and Inline::C brought XS from "hard things possible" to
"hard things simple". People with basic knowledge of Perl and C could combine
the two, without having to learn the entirety of the black art of XS.
Soon after, support was added for C++, Java and ~25 other languages. Inline
was consider rather successful.
The missing piece of all this is that Inline (C, C++) was never really
polished to write CPAN modules; CPAN dists that would handle the compilation
parts at install/build time, and then become nearly indistinguishable from
plain XS modules after installation.
A common pattern has been for module programmers to start with Inline::C and
then use it to learn XS, so that they can release the modules to CPAN. Often
Inline::C has been used to generate the XS which is then pasted into a module
distribution with a few adaptations to fit the distribution's framework.
Though very successful, Inline should go further to simplify and remove the
need for authors to manually work through tedious and error-prone steps.
In the summer of 2014, a number of core Inline developers came together to get
Inline up to modern standards. We've decided the next big move is to polish up
Inline so that it is ModuleReady™; so that it supports module authorship and
This will allow many more people to use C and C++ to make Perl modules,
without ever needing to learn XS boilerplate, which is a significant barrier
to entry. Those who already know XS will still be pleased to rediscover that
Inline is an easy way to create XS, and that these enhancements make it a good
choice as a basis for XS module distributions.
- Allow compilation of inlined C code to happen during a module's build time, and then allow Inline to get out of the way to a greater degree than currently happens.
use Inline not trigger a C compile or a C source check when running installed.
- Provide support integration for:
- Make sure that the right things happen at test and build time (vs runtime).
- Test that all works properly with C++.
- Provide support for C modules where the C code is not 'inlined'
- Release a few current XS modules using Inline.
Inline development has resurged in #inline on irc.perl.org. The primary
maintainers of Inline, Inline::C and Inline::CPP (C++) are the ones who want
to make this happen.
These three modules above have already undergone considerable refactoring,
modernization and bug fixing in the past 3 months, with many releases to
show for it.
The goals for this grant are not conceptually hard, but require some focus.
This grant will give us the time to focus. There is no reason to expect this
work will take more than 2 months.
Identify existing (or create new) modules that use different 'XS' strategies. These will be the driving test cases.
They should include:
- Inlined C
- External C
- Currently using XS
- Trying to ship with Inline
Adjust Inline to know about development vs build vs installed runtimes.
There are a few strategies. Likely there will be a dependency on a small
module, say Inline::Module, that knows how to DTRTs, at the right times.
Facilitate making Inline and Inline::C/CPP authoring and build tools for distributions, not just runtime tools.
- Make sure that Inline::C and Inline::CPP work right. In particular, upgrade the grammar tests and parsing to handle many C and C++ constructs that have been found to be lacking in current parsing solutions.
Release real modules to CPAN that exercise each of the new development strategies.
Watch for results on cpantesters.
Write automation helpers:
- Dist::Zilla plugin
- Module::Install plugin
- Documentation for ExtUtils::MakeMaker and Module::Build
Write documention for how to be an "XS" author without learning XS boilerplate.
Likely this will include a tutorial.
David and Ingy see no reason this can't be done in two months. One month for
code and modules. One month for documentation and testing. We hope to work on
other grants, each about 2 months, so there is good reason to get this one
done, done right, and out of the way.
Release of these modules to CPAN (with above support):
Ingy döt Net is the original creator of Inline and Inline::C. His primary
focus in Perl is to bring the "hard" things into the hands of beginners.
David Oswald has been maintaining Inline::CPP for four years, and is the only
person to have made releases on Inline::CPP since 2003.
Ingy and David work well together and have decided to collaborate on a number
of big projects that benefit Perl and Software Development. Inline was the
obvious first choice.