Re: Calling C/C++ library routines

28 views
Skip to first unread message

MrJoltCola

unread,
Feb 25, 2005, 1:40:15 PM2/25/05
to vlad florentino, perl6-i...@perl.org
At 01:27 PM 2/25/2005, vlad florentino wrote:
>Is there now, or will there be in the future, any way to call C/C++
>library routines from within Parrot? For example, a mysql, pcre or
>libcurl library. Either static or dynamic.

C yes. C shares objects are dynamically loadable by Parrot.
C++? Not directly, you'll need to wrap any C++ APIs in "extern C" stubs
to get at them from Parrot and make sure you stuff any object pointers into
a PMC. It has been done, an example is the C++ Qt Toolkit.

-Melvin


Vlad Florentino

unread,
Feb 25, 2005, 1:27:49 PM2/25/05
to perl6-i...@perl.org
Hello,
I've been developing a compiler that will target Parrot for the last
couple of months. I have a question.

I've only been reading the list for a short time (1 - 1 1/2 months). I
was reading some of the past articles, but there's just so many of
them that I figure I might as well just ask the question directly.

Is there now, or will there be in the future, any way to call C/C++
library routines from within Parrot? For example, a mysql, pcre or
libcurl library. Either static or dynamic.

I haven't actually program using either PASM or PIR(?) yet, since I'm
still working on the details of my compiler, such as the grammar, etc;
but I'm curious if this feature is available as this is something I
have to take into consideration right now.

Thanks

$vlad.f()

Vlad Florentino

unread,
Feb 25, 2005, 2:14:04 PM2/25/05
to perl6-i...@perl.org
---------- Forwarded message ----------
From: vlad florentino <mega...@gmail.com>
Date: Fri, 25 Feb 2005 13:56:33 -0500
Subject: Re: Calling C/C++ library routines
To: MrJoltCola <mrjol...@mindspring.com>

Wow, that's great!

Are there any examples showing how one can call C routines in Parrot?

$vlad.f()

Chromatic

unread,
Feb 25, 2005, 2:35:41 PM2/25/05
to vlad florentino, p6i
On Fri, 2005-02-25 at 14:18 -0500, Will Coleda wrote:

> http://cvs.perl.org/viewcvs/cvs-public/parrot/examples/pni/
>
> has examples for QT, sdl, and the win32 API.

The actual NCI stuff (for SDL bindings, at least) is in:

http://cvs.perl.org/viewcvs/cvs-public/parrot/runtime/parrot/library/

-- c

Will Coleda

unread,
Feb 25, 2005, 2:18:00 PM2/25/05
to vlad florentino, perl6-i...@perl.org
http://cvs.perl.org/viewcvs/cvs-public/parrot/examples/pni/

has examples for QT, sdl, and the win32 API.

Regards.

Reply all
Reply to author
Forward
0 new messages