Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Perl 6 and trend towards web-based applications

by grinder (Bishop)
on Jan 15, 2005 at 16:30 UTC ( [id://422521]=note: print w/replies, xml ) Need Help??


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

will we still have that ability [...] to interface with existing C libraries

Of course we will, and it will be much, much easier. For starters, check out Parrot's Foreign Library Access. You can open a shared library, DLL or whatever, and then just start using it. Parrot already has a fair amount of smarts to let you specify the calling conventions. Many XS problems will simply vanish because of the level of support that Parrot provides intrinsically.

And if Parrot can do that, you can be sure it will be easy to tap from Perl. And it will be Good.

- another intruder with the mooring in the heart of the Perl

Replies are listed 'Best First'.
Re^4: Perl 6 and trend towards web-based applications
by thor (Priest) on Jan 15, 2005 at 17:56 UTC
    Hmm...somehow, I doubt that it will be as easy as the doc you pointed to suggests. If it were that easy, why haven't C compilers gotten rid of the need for header files? Something tells me that you'll at least need the header file.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      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.

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://422521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found