Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CPAN Upload: A/AB/ABERGMAN/ponie-2.tar.gz - Ponie Development Release 2

8 views
Skip to first unread message

Arthur Bergman

unread,
Mar 12, 2004, 11:54:26 AM3/12/04
to perl6-i...@perl.org, p5p, poni...@perl.org
This is Ponie, development release 2
------------------------------------

"And, isn't sanity really just a one-trick ponie anyway? I mean all
you get is one trick, rational thinking, but when you're good and
crazy, oooh, oooh, oooh, the sky is the limit." -- the tick


Welcome to this second development release of ponie, the mix of perl5
and parrot. Ponie embeds a parrot interpreter inside perl5 and hands
off tasks to it, the goal of the project is to hand of all data and
bytecode handling to parrot.

With this release all internal macros that poke at perl data types are
converted to be real C functions and to check if they are dealing with
traditional perl data types or PMC (Parrot data types) data. Perl
lvalues, arrays and hashes are also hidden inside PMCs but still access
their core data using traditional macros. The goal and purpose of this
release is to make sure this approach keeps on working with the XS
modules available on CPAN and to let people test with their own source
code. No changes where made to any of the core XS modules.

This is based on perl 5.9.1 as it existed in September, when 5.9.1 is
really released ponie will be updated to that version, this might lead
to there being perl bugs in ponie that are fixed in later versions on
ponie.

If you embed perl, nothing should have changed but parrot takes control
over a substantial part of the interface to the operating system, this
might cause problems for you. (One example is that parrot seems to
hijack SIGINT currently, and weird issues with STDERR).

-----------------------------------

Enjoy
Arthur

Marcus Holland-Moritz

unread,
Mar 13, 2004, 7:51:24 PM3/13/04
to Arthur Bergman, perl6-i...@perl.org, p5p, poni...@perl.org
On 2004-03-12, at 16:54:26 +0000, Arthur Bergman wrote:

> This is Ponie, development release 2
> ------------------------------------

First of all, this is just working great! All of my XS modules
compiled (almost) out of the box and worked really fine.

I noticed one small thing, however. The parrot code contains a
couple of quite "generic" symbols. While all (most) perl global
symbols are prefixed by Perl_, perl_, PerlIO_ or something similar,
not all of parrots symbols have a similar prefix.

One of my modules embeds the ucpp preprocessor, which has a
function init_tables(). The same function exists in parrot.
When I ran the test suite, parrot's function was called instead
of ucpp's, which resulted in a segfault. Of course, it is also
bad of ucpp to have such generic symbols. I already had a patch
to prefix ucpp's symbols, so I got things working quickly.

I just wanted to draw attention to the fact that it might be
useful to have a prefix all of parrot's global symbols.

Thanks for the great work!

Marcus

--
Theory of Selective Supervision:
The one time in the day that you lean back and relax is
the one time the boss walks through the office.

Andrew Dougherty

unread,
Mar 15, 2004, 9:41:59 AM3/15/04
to poni...@perl.org, Perl6 Internals, p5p
Whilst trying to build ponie-2 on Solaris 8, I came across the following
issue: In order to use threads, both perl-5.[89].x and parrot need to
call some sort of yield() function.

In parrot, sched_yield is used; this function is available in the -lrt
library, so the solaris hints file adds that in. There appears to be no
way to override this from the Configure.pl command line.

In perl, the plain yield() function is used; this function is available in
the standard C library, so -lrt is not used. (Indeed, it's not even
mentioned in Configure.) The hints/solaris_2.sh file unconditionally sets
sched_yield='yield' (bad hints file! I'll supply a patch for that
separately.)

Underneath it all, it doesn't matter -- both functions are the same on
Solaris -- but leaving things the way they are gives the following error
message for ponie-2:

cc -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/SC4.2/lib -L/home/doughera/src/parrot/ponie-andy/parrot/blib/lib -o miniperl \
miniperlmain.o opmini.o libperl.a -lsocket -lnsl -ldl -lm -lpthread -lc -lparrot
Undefined first referenced
symbol in file
sched_yield /home/doughera/src/parrot/ponie-andy/parrot/blib/lib/libparrot.a(thread.o)

One fix for ponie may be to add rt to the $libswanted when it calls perl's
Configure (adding -A prepend:libswanted=rt should do the trick, but I
haven't tested it).

Longer term, it'd probably be good for parrot to have yield() vs.
sched_yield() set by some Configure.pl-time variable. For now, it would
likely be sufficient to simply key off of perl5's $Config{sched_yield}.

Similarly, perl's Configure/hints combination ought to be a bit more
flexible about yield() vs. sched_yield(). This would help make perl
slightly more flexible in adapting to being extended or embedded.

--
Andy Dougherty doug...@lafayette.edu

Nick Ing-Simmons

unread,
Mar 16, 2004, 5:29:22 AM3/16/04
to doug...@lafayette.edu, Alan.B...@uk.sun.com, Perl6 Internals, poni...@perl.org, p5p
Andrew Dougherty <doug...@lafayette.edu> writes:
>Whilst trying to build ponie-2 on Solaris 8, I came across the following
>issue: In order to use threads, both perl-5.[89].x and parrot need to
>call some sort of yield() function.
>
>In parrot, sched_yield is used; this function is available in the -lrt
>library, so the solaris hints file adds that in. There appears to be no
>way to override this from the Configure.pl command line.
>
>In perl, the plain yield() function is used; this function is available in
>the standard C library, so -lrt is not used. (Indeed, it's not even
>mentioned in Configure.) The hints/solaris_2.sh file unconditionally sets
>sched_yield='yield' (bad hints file! I'll supply a patch for that
>separately.)
>
>Underneath it all, it doesn't matter -- both functions are the same on
>Solaris -- but leaving things the way they are gives the following error
>message for ponie-2:

The worry might be that adding -lrt may have other side effects.
Alan?

Andrew Dougherty

unread,
Mar 16, 2004, 10:23:49 AM3/16/04
to Nick Ing-Simmons, Alan.B...@uk.sun.com, Perl6 Internals, poni...@perl.org, p5p
On Tue, 16 Mar 2004, Nick Ing-Simmons wrote:

> Andrew Dougherty <doug...@lafayette.edu> writes:
> >Whilst trying to build ponie-2 on Solaris 8, I came across the following
> >issue: In order to use threads, both perl-5.[89].x and parrot need to
> >call some sort of yield() function.
> >
> >In parrot, sched_yield is used; this function is available in the -lrt
> >library, so the solaris hints file adds that in. There appears to be no
> >way to override this from the Configure.pl command line.
> >
> >In perl, the plain yield() function is used; this function is available in
> >the standard C library, so -lrt is not used. (Indeed, it's not even
> >mentioned in Configure.) The hints/solaris_2.sh file unconditionally sets
> >sched_yield='yield' (bad hints file! I'll supply a patch for that
> >separately.)
> >
> >Underneath it all, it doesn't matter -- both functions are the same on
> >Solaris -- but leaving things the way they are gives the following error
> >message for ponie-2:
>
> The worry might be that adding -lrt may have other side effects.
> Alan?

Alan's the one who recommended perl not bother with -lrt since it didn't
add anything useful. He removed it as part of a larger Solaris
loading/linking cleanup. I don't think there were any conflicts with
stuff in -lrt at the time, but avoiding dragging in unnecessary libraries
is usually a good idea all around, so his approach looks fine to me.

As far as I can tell, both parrot and perl have taken a sensible approach
to dealing with sched_yield(); they just don't play well together, and
neither is easily overrideable from the Configure command line. Since
each is ultimately supposed to be able to be embedded and extended, I
think each needs to be a bit more flexible.

> >Longer term, it'd probably be good for parrot to have yield() vs.
> >sched_yield() set by some Configure.pl-time variable. For now, it would
> >likely be sufficient to simply key off of perl5's $Config{sched_yield}.
> >
> >Similarly, perl's Configure/hints combination ought to be a bit more
> >flexible about yield() vs. sched_yield(). This would help make perl
> >slightly more flexible in adapting to being extended or embedded.

I can patch perl5's Configure/hints combination (and hence suggest a
work-around for ponie), but I think someone else ought to look at the
parrot side of things too.

--
Andy Dougherty doug...@lafayette.edu

Andrew Dougherty

unread,
Mar 16, 2004, 4:38:58 PM3/16/04
to Perl Porters
On Tue, 16 Mar 2004, Andrew Dougherty wrote:

> Yes, but then some other embedder who really did want to use sched_yield
> would be out of luck. As I said, I really think both perl and parrot need
> to be more flexible here. I know how to do it in perl's Configure. I
> don't know how to do it with parrot's.

Here's a patch to make it easier to override perl5's selection of yield()
over sched_yield(). Now you can do sh Configure -Dsched_yield=sched_yield
and it will do what you expect. In particular, ponie could use this
right now. More generally, anyone embedding perl and expecting to find
sched_yield() might find this useful.

--- perl-current/hints/solaris_2.sh Sun Nov 23 18:18:53 2003
+++ perl-andy/hints/solaris_2.sh Tue Mar 16 15:08:24 2004
@@ -345,10 +345,24 @@
$define|true|[yY]*)
ccflags="-D_REENTRANT $ccflags"

- sched_yield='yield'
+ # -lpthread overrides some lib C functions, so put it before c.
set `echo X "$libswanted "| sed -e "s/ c / pthread c /"`
shift
libswanted="$*"
+
+ # sched_yield is available in the -lrt library. However,
+ # we can also pick up the equivalent yield() function in the
+ # normal C library. To avoid pulling in unnecessary
+ # libraries, we'll normally avoid sched_yield()/-lrt and
+ # just use yield(). However, we'll honor a command-line
+ # override.
+ # If we end up using sched_yield, we're going to need -lrt.
+ sched_yield=${sched_yield:-yield}
+ if test "$sched_yield" = "sched_yield"; then
+ set `echo X "$libswanted "| sed -e "s/ pthread / rt pthread /"`
+ shift
+ libswanted="$*"
+ fi

# On Solaris 2.6 x86 there is a bug with sigsetjmp() and siglongjmp()
# when linked with the threads library, such that whatever positive

--
Andy Dougherty doug...@lafayette.edu

Rafael Garcia-Suarez

unread,
Mar 16, 2004, 4:49:21 PM3/16/04
to Andrew Dougherty, Perl Porters
Andrew Dougherty wrote:
>
> On Tue, 16 Mar 2004, Andrew Dougherty wrote:
>
> > Yes, but then some other embedder who really did want to use sched_yield
> > would be out of luck. As I said, I really think both perl and parrot need
> > to be more flexible here. I know how to do it in perl's Configure. I
> > don't know how to do it with parrot's.
>
> Here's a patch to make it easier to override perl5's selection of yield()
> over sched_yield(). Now you can do sh Configure -Dsched_yield=sched_yield
> and it will do what you expect. In particular, ponie could use this
> right now. More generally, anyone embedding perl and expecting to find
> sched_yield() might find this useful.
>
> --- perl-current/hints/solaris_2.sh Sun Nov 23 18:18:53 2003

Thanks, applied as #22512.

Nick Ing-Simmons

unread,
Mar 19, 2004, 9:19:09 AM3/19/04
to s...@nanisky.com, perl6-i...@perl.org, poni...@perl.org, p5p
Arthur Bergman <s...@nanisky.com> writes:
>This is Ponie, development release 2
>------------------------------------
>
> "And, isn't sanity really just a one-trick ponie anyway? I mean all
>you get is one trick, rational thinking, but when you're good and
>crazy, oooh, oooh, oooh, the sky is the limit." -- the tick
>
>
>Welcome to this second development release of ponie, the mix of perl5
>and parrot. Ponie embeds a parrot interpreter inside perl5 and hands
>off tasks to it, the goal of the project is to hand of all data and
>bytecode handling to parrot.
>
>With this release all internal macros that poke at perl data types are
>converted to be real C functions and to check if they are dealing with
>traditional perl data types or PMC (Parrot data types) data. Perl
>lvalues, arrays and hashes are also hidden inside PMCs but still access
>their core data using traditional macros. The goal and purpose of this
>release is to make sure this approach keeps on working with the XS
>modules available on CPAN and to let people test with their own source
>code. No changes where made to any of the core XS modules.

So ponie-2 compiles and passes all its tests for me.
So how do I see if it can handle the XS module from hell - Tk ?


Marcus Holland-Moritz

unread,
Mar 19, 2004, 11:21:16 AM3/19/04
to Nick Ing-Simmons, p5p

I've tested all my XS modules (successfully) using:

mhx@r2d2 $ export PERL5LIB=~/src/ponie/ponie-2/perl/lib
mhx@r2d2 $ ~/src/ponie/ponie-2/ponie Makefile.PL PERL_SRC=~/src/ponie/ponie-2/perl
mhx@r2d2 $ make
mhx@r2d2 $ make test

But unfortunately, this doesn't seem to work for Tk...

mhx@r2d2 $ ~/src/ponie/ponie-2/ponie Makefile.PL PERL_SRC=~/src/ponie/ponie-2/perl
Cannot find '/usr/lib/perl5/5.9.0/i686-linux-thread/CORE/perl.h' have you installed /home/mhx/src/ponie/ponie-2/ponie?
Compilation failed in require at Makefile.PL line 32.
BEGIN failed--compilation aborted at Makefile.PL line 34.

Why does Makefile.PL require perl/ponie to be installed?

Marcus

--
In theory, there is no difference between theory and practice. In practice,
there is.

Nick Ing-Simmons

unread,
Mar 21, 2004, 5:46:23 PM3/21/04
to mhx-...@gmx.net, Nick Ing-Simmons, p5p
Marcus Holland-Moritz <mhx-...@gmx.net> writes:
>I've tested all my XS modules (successfully) using:
>
> mhx@r2d2 $ export PERL5LIB=~/src/ponie/ponie-2/perl/lib
> mhx@r2d2 $ ~/src/ponie/ponie-2/ponie Makefile.PL PERL_SRC=~/src/ponie/ponie-2/perl
> mhx@r2d2 $ make
> mhx@r2d2 $ make test
>
>But unfortunately, this doesn't seem to work for Tk...
>
> mhx@r2d2 $ ~/src/ponie/ponie-2/ponie Makefile.PL PERL_SRC=~/src/ponie/ponie-2/perl
> Cannot find '/usr/lib/perl5/5.9.0/i686-linux-thread/CORE/perl.h' have you installed /home/mhx/src/ponie/ponie-2/ponie?
> Compilation failed in require at Makefile.PL line 32.
> BEGIN failed--compilation aborted at Makefile.PL line 34.
>
>Why does Makefile.PL require perl/ponie to be installed?

Because I have had too many "bug" reports due folk building
with one perl and running with another.
But I could probably allow the PERL_SRC thing.

>
>Marcus

Arthur Bergman

unread,
Mar 22, 2004, 5:59:13 AM3/22/04
to Nick Ing-Simmons, Nick Ing-Simmons, mhx-...@gmx.net, p5p

On 21 Mar 2004, at 22:46, Nick Ing-Simmons wrote:

>>
>> mhx@r2d2 $ ~/src/ponie/ponie-2/ponie Makefile.PL
>> PERL_SRC=~/src/ponie/ponie-2/perl
>> Cannot find '/usr/lib/perl5/5.9.0/i686-linux-thread/CORE/perl.h'
>> have you installed /home/mhx/src/ponie/ponie-2/ponie?
>> Compilation failed in require at Makefile.PL line 32.
>> BEGIN failed--compilation aborted at Makefile.PL line 34.
>>
>> Why does Makefile.PL require perl/ponie to be installed?
>
> Because I have had too many "bug" reports due folk building
> with one perl and running with another.
> But I could probably allow the PERL_SRC thing.
>
>

The problem here is that parrot yet doesn't allow for installing, so I
decided to wait until they fix it to enable it, but for the next
release I suspect I will allow it to install and manually copy over the
libparrot needed for operations since that is the only thing needed.

Thanks for testing.

Arthur

Steve Hay

unread,
Mar 22, 2004, 11:21:35 AM3/22/04
to Arthur Bergman, perl6-i...@perl.org, p5p, poni...@perl.org
Arthur Bergman wrote:

>This is Ponie, development release 2
>
>

How does one build this on Win32 with MSVC++?

Running the top-level "perl Configure.pl" got me nowhere, so I cd'd into
parrot and ran "perl Configure.pl" there. That ran OK, so I tried
"nmake" next.

It almost worked. The compiler complained a couple of times about
struct tm being undefined; I included <time.h> in a couple of places and
those errors went away. libparrot_s.lib was then linked successfully,
but linking parrot.exe fell over with three unresolved externals:
asctime_r, gmtime_r and localtime_r. These are not present in the VC++
header files.

Did I configure it wrongly, or is there a problem here?

- Steve

------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.

Steve Hay

unread,
Mar 22, 2004, 1:03:01 PM3/22/04
to Steve Hay, Arthur Bergman, perl6-i...@perl.org, p5p, poni...@perl.org
Steve Hay wrote:

>Arthur Bergman wrote:
>
>
>
>>This is Ponie, development release 2
>>
>>
>>
>>
>How does one build this on Win32 with MSVC++?
>
>Running the top-level "perl Configure.pl" got me nowhere, so I cd'd into
>parrot and ran "perl Configure.pl" there. That ran OK, so I tried
>"nmake" next.
>
>It almost worked. The compiler complained a couple of times about
>struct tm being undefined; I included <time.h> in a couple of places and
>those errors went away. libparrot_s.lib was then linked successfully,
>but linking parrot.exe fell over with three unresolved externals:
>asctime_r, gmtime_r and localtime_r. These are not present in the VC++
>header files.
>

OK, I've got parrot built now by using the latest CVS version which
fixes those problems.

How do I do the rest of what the top-level Configure.pl would have
done? The README says to "reconfigure perl with all the correct
settings", but I don't know what that means.

Looks like that Configure.pl runs perl's "Configure" shell script with a
bunch of arguments pulled from various sources, but on Win32 you don't
use that Configure script to build perl -- instead, you edit
win32/Makefile to suit, then cd to win32/ and type "nmake".

So I guess the question is: What do I need to do to win32/Makefile to
have perl built with parrot?

0 new messages