Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by thor (Priest)
on Jan 15, 2005 at 17:56 UTC ( [id://422532]=note: print w/replies, xml ) Need Help??


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

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

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

Replies are listed 'Best First'.
Re^5: Perl 6 and trend towards web-based applications
by duff (Parson) on Jan 15, 2005 at 19:47 UTC

    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.

        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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found