SPUG: ANNOUNCE: Inline 0.40 Major Release

Brian Ingerson briani at activestate.com
Sun May 27 23:30:53 CDT 2001


I am pleased to announce the release of Inline-0.40.

This is a major release for Inline. Possibly the most important one to
date. That's because you can now create CPAN extension modules that look
and behave just like ones written in XS. In prior versions of Inline,
writing extension modules was possible, but problematic. The official
word on the Inline mailing list was "wait for version 0.40". The wait is
over.

The new features of Inline-0.40 include:

1) Inline::MakeMaker. This is a drop-in replacement for
ExtUtils::MakeMaker. It actually loads the ExtUtils counterpart, but
grabs control long enough to make sure that the generated Makefile is
"Inline aware".
2) Short file names for objects. For instance a typical module in 0.34
might have produced an object called:

 
auto/Foo_C_3cee729d1d942c6792ca5a741dc21879/Foo_C_3cee729d1d942c6792ca5a741dc21879.so

with 0.40 it would be:

    auto/Foo/Foo.so

3) An object validation file. For the object above you'd get:

    auto/Foo/Foo.inl

which might contain:

    md5 : 3cee729d1d942c6792ca5a741dc21879
    name : Foo
    version : ""
    language : C
    language_id : C
    installed : 0
    date_compiled : Sun May 27 18:52:27 2001
    inline_version : 0.40
    ILSM : %
        module : Inline::C
        suffix : so
        type : compiled
    Config : %
        apiversion : 5.6.1
        archname : i686-linux-thread-multi
        cc : gcc
        ccflags : -D_REENTRANT ...
        ld : gcc
        osname : linux
        osvers : 2.2.17
        so : so
        version : 5.6.1

4) Support for creating binary distributions. Even ones without the C
source.
5) Support for Damian Conway's new module: Inline::Files.

The net effect of all this is that you can now create a C-based
extension module for CPAN called Math::Simple and it would look like:

---8<--- (Simple.pm)
package Math::Simple;
use strict;
require Exporter;
@Math::Simple::ISA = qw(Exporter);
@Math::Simple::EXPORT = qw(add subtract);
$Math::Simple::VERSION = '1.23';

use Inline (C => DATA =>
            NAME => 'Math::Simple',
            VERSION => '1.23',
           );
1;
__DATA__
__C__
int add (int x, int y) {
    return x + y;
}
int subtract (int x, int y) {
    return x - y;
}
---8<---

And the Makefile.PL would look like:

---8<---
use Inline::MakeMaker;

WriteMakefile( NAME => 'Math::Simple',
               VERSION_FROM => 'Simple.pm',
             );
---8<---

And that's it. Just add a MANIFEST, a README, a test harness (test.pl)
and some POD doc. Run 'make dist', and ship it.

Now please don't actually *do* that with Math::Simple or I'll be hearing
about it for the rest of time.

NOTE: For your convenience I've included all the Math::Simple files in
the distribution, just in case you want to play with them.

---

This release has been in a pre-release test cycle for the past two
weeks. It has undergone 9 revisions. Many thanks to the members of
inline at perl.org who helped me iron out the wrinkles.

Also please note that this release breaks compatability with all of the
other Inline::* modules (like Inline::Java for instance). The authors of
these modules are all aware of this and will submit upgrades to their
software within the next couple days. If you use any of these modules,
please wait for the upgrades before installing Inline-0.40.

Finally, be assured that the public interface has not changed. Your
existing code should work fine with this release.

The README follows. 

Enjoy, Brian Ingerson

--------------------------------------------------------------------
INTRODUCTION:

Inline.pm - Write Perl subroutines in other programming languages.

Inline lets you write Perl subroutines in other programming languages 
like C, C++, Java, Python, Tcl and even Assembly. You don't need to 
compile anything. All the details are handled transparently so you 
can just run your Perl script like normal.

Example:

    use Inline::Files;
    use Inline C;
    print JAxH('Inline'), "\n";
    
    __C__
    SV* JAxH(char* x) {
        return newSVpvf ("Just Another %s Hacker",x);
    }
    
When run, this complete program prints:

    Just Another Inline Hacker

The one line version is:

    perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf("Just
Another %s Hacker",x);}};print JAxH+Inline'

---------------------------------------------------------------
FEATURES:

Inline version 0.40 is a major upgrade. It includes:
+ Inline::MakeMaker
  + Rock solid support for writing CPAN extension modules
+ Short file names. 
  + No more
_Inline/lib/auto/Foo_C_3cee729d1d942c6792ca5a741dc21879/Foo_C_3cee729d1d942c6792ca5a741dc21879.so
  + Now it's _Inline/lib/auto/Foo/Foo.so
+ Support for creating binary distributions.
  + Can even do it without shipping C source code.
+ Support for Damian Conway's Inline::Files
  + No more __END__ markers.
+ Safe new config and caching format.
  + Similar to Data::Denter format
+ New Inline-FAQ.pod.

Inline version 0.33 is a minor upgrade with the following changes:

+ Support for Inline::Struct and Inline::Filters
+ Added ENABLE and DISABLE configuration modifiers.
+ C installation is optional
+ Test harness reworked. Faster testing.
+ Fixed all reported (and some unreported) bugs.
+ Documentation enhancements.

Inline version 0.32 is a minor upgrade with the following changes:

+ Addition of UNTAINT, SAFEMODE, GLOBAL_LOAD, MAKE, and LDDLFLAGS
  configuration options.
+ Fixed all reported (and some unreported) bugs.
+ Documentation enhancements.

Inline version 0.31 is a minor upgrade with the following changes:

+ "use Inline C;" is now a synonym for "use Inline C => DATA;"
+ Default build/install directory changed from "blib_I/" to ".Inline/"
+ Build/Install directory structure simplified.
  + Short install paths.
  + Build areas in ".Inline/build/" subdirectory.
+ Added 'CC', 'CCFLAGS', 'LD', and 'LDFLAGS' config options to C.
+ More recipes in Cookbook.

Inline version 0.30 is a major upgrade from previous verions. It
includes:

+ Integrated support for typemap files in C.
  + All the recognized types now come *only* from typemaps. 
  + The default types come from the default typemap installed with core
Perl.
  + Typemaps are used to modify the Parse::RecDescent grammar for
parsing C.
  + This means you can easily use your existing typemaps.
+ Language support completely separated from base Inline code.
  + Beta supoort for C (Inline::C, included)
  + Alpha support for C++ (Inline::CPP, available separately)
  + Alpha support for Python (Inline::Python, available separately)
  + Support for 'embedding' Perl in C with my new programming language,
CPR. 
    (Inline::CPR, available separately) This one may warp your mind :^)
  + Simple API for adding your own language support.
    + Write your own Inline::Foo
    + Write your own implementation of Inline::C, or just modify 
      Inline::C::grammar.
  + Support for interpreted languages in addition to compiled ones.
+ Autodetection of new Inline language modules.
+ Much easier and more powerful configuration syntax.
  + More XS and MakeMaker features exposed for configuration (for C and
C++).
+ Flexible new syntax for specifying source code.
  + Use DATA section for AutoLoader, Inline, and POD simultaneously.
+ Support for using Inline 'with' other modules.
  + "use Inline with 'Event';" lets Event.pm pass config info to
Inline.pm.
  + Event.pm 0.80 has built in support for Inline.pm 0.30 and higher.
    + Write Event callbacks in C with extreme ease.
+ More documentation
  + perldoc Inline
  + perldoc Inline-FAQ
  + perldoc Inline-API
  + perldoc Inline::C
  + perldoc Inline::C-Cookbook
+ Better error messages and easier debugging.
+ Mailing list: inline at perl.org

Other features of Inline.pm include:

= Automatically compiles your source code and caches the shared object.
= Automatically DynaLoads the shared object and binds it to Perl.
= Recompiles only when the C code changes. 
= Changing the Perl code will not cause a recompile of the C code.
= Support for writing extension modules, suitable for distributing to
the CPAN.
= Support for generating and binding Inline subs at run time. <bind()>
= Works on all Unix and MS Windows configurations.

-------------------------------------------------------------------------------
INSTALLATION:

This module requires the Digest::MD5 and Parse::RecDescent modules. It
also
requires the appropriate C compiler. (Where appropriate means the one
referred
to in your Config.pm) 

To install Inline do this:

perl Makefile.PL
make
make test
make install

On ActivePerl for MSWin32, use nmake instead of make. Or just use:
    ppm install Inline

For convenience, Inline::C is packaged with Inline, and will be
automatically
installed as well.

-------------------------------------------------------------------------------
INFORMATION:

= For more information on Inline, see 'perldoc Inline' and 'perldoc
Inline-FAQ'
= For information about Inline::, see 'perldoc Inline::C' and
  'perldoc Inline::C-Cookbook'
= For information on writing your own Inline extension see 'perldoc
Inline-API'
= For information about the Perl5 internal C API, see 'perldoc perlapi'
or
  try http://www.perldoc.com/perl5.6/pod/perlapi.html
= The Fall 2000 edition of The Perl Journal has an article about Inline

The Inline.pm mailing list is inline at perl.org. Send email to 
inline-subscribe at perl.org to subscribe.

Please send questions and comments to "Brian Ingerson" <INGY at cpan.org>

Copyright (c) 2001, Brian Ingerson. All Rights Reserved.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list