in reply to Re^4: Perl 6 and trend towards web-based applications
in thread Perl 6 and trend towards web-based applications

As a developer of the glue code, you'll need to have intimate knowledge of the function signatures and data structures contained within the header file (assuming you're gluing some existing C library to perl). But once the glue is developed, you won't need the header file at all because all of the info will be in the parrot source file or the perl6 module. In other words the C header file becomes a perl and/or parrot source file. Writing in perl for extensions is a whole heck of a lot easier than writing some in perl, some in C and requiring a C compiler.

  • Comment on Re^5: Perl 6 and trend towards web-based applications

Replies are listed 'Best First'.
Re^6: Perl 6 and trend towards web-based applications
by Tanktalus (Canon) on Jan 15, 2005 at 22:35 UTC

    And then, some enterprising perl6 developer(s) will:

    • write a module that takes a full C-style prototype, and converts it into the glue code that can be saved into a new module or can be eval'd for immediate execution.
    • write a module that takes the previous module, combines it with the C parsing module that already exists in Perl5, and you can then just tell it what function you want, what header file to look in, and it will find the full prototype, again, either printing out the glue code, or eval'ing it for immediate use, depending on the caller
    making the whole exercise in writing glue code incredibly trivial.

      Sounds an aweful lot like Win32::API::Prototype.

      Paste the C function prototype, and the name of the dll and it returns a coderef that you call from perl using perl variables for the parameters.


      Examine what is said, not who speaks.
      Silence betokens consent.
      Love the truth but pardon error.
        Which isn't on CPAN. :-)

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.