Parrot as an extension language

2005-05-17 Thread Colin Paul Adams
Hello,

I am writing an XSLT 2.0 processor, and I want to give users the
option to write their own message and error handling routines and the
like in their favourite scripting language. So I thought of using
parrot.

But when I look at http://www.parrotcode.org/docs/embed.html, I can
see no way of getting information back from the script - not even an
exit code. Is there anyway of doing this that I have missed?
-- 
Colin Adams
Preston Lancashire


Re: Parrot as an extension language

2005-05-17 Thread Jeff Horwitz
you'll probably want to use the Parrot_call_sub_* API to call individual
subroutines and get return values.  perldoc extend.c in the parrot
source for more info.  you might also have a look at the mod_parrot source
(http://www.smashing.org/mod_parrot), which is one of the few apps
embedding parrot at the moment.  the other is pugs (http://www.pugscode.org),
but it's written in haskell.

-jeff


On 17 May 2005, Colin Paul Adams wrote:

 Hello,

 I am writing an XSLT 2.0 processor, and I want to give users the
 option to write their own message and error handling routines and the
 like in their favourite scripting language. So I thought of using
 parrot.

 But when I look at http://www.parrotcode.org/docs/embed.html, I can
 see no way of getting information back from the script - not even an
 exit code. Is there anyway of doing this that I have missed?
 --
 Colin Adams
 Preston Lancashire




Re: Parrot as an extension language

2005-05-17 Thread Autrijus Tang
On Tue, May 17, 2005 at 03:00:14PM +0100, Colin Paul Adams wrote:
 But when I look at http://www.parrotcode.org/docs/embed.html, I can
 see no way of getting information back from the script - not even an
 exit code. Is there anyway of doing this that I have missed?

You may wish to use Parrot_call_sub's SS form, where you pass in a
string and get back a string.  Something like this:

my $interp = Parrot_new(undef);

# ... load a .pir file or some other code into $interp ...

my $code_pmc = Parrot_find_global(
$interp,
const_string(Namespace),
const_string(sub_name),
);

my $return_str = Parrot_call_sub(
$interp,
$code_pmc,
const_string(SS),
const_string(Your_input_string_here),
);

Thanks,
/Autrijus/


pgpMe8pdQExhO.pgp
Description: PGP signature


Re: [perl #35450] Null pointer dereference in classes/sub.pmc

2005-05-17 Thread Leopold Toetsch
Adrian Taylor [EMAIL PROTECTED] wrote:
 Hi Leo,

 OK, you've confused me now :-) You're getting the same results as me
 (which I also get with the latest parrot, shown below).

I had missed that Parrot is run anyway.

Should be fixed now as of Parrot rev 8110.
leo



t/src/manifest.t failed

2005-05-17 Thread Dino Morelli
I'm seeing the following test failure at r8113

t/src/manifestNOK 6# Failed test (t/src/manifest.t at line 79)
# Extra files:
#   dynclasses/build.pl
#   editor/imc.vim
#   install_config.fpmc
#   t/src/.manifest.t.swp
#   test.imc
#   test.pbc
# Looks like you failed 1 tests of 6.
t/src/manifestdubious

I started tracing through how it got here. I gather that MANIFEST.SKIP
is constructed by gen_manifest_skip.pl which is fed by
Parrot::Distribution which gets its info from svn:ignore

I see that stuff like the .swp file above should probably be an ignore
for the entire project for something like ^\..*\.sw.$
(Vim swap file)

But the other things, I'm new and not sure yet what they are.

I think the inc.vim may have been created by the Makefile in editor/
when I had it create syntax highlighting.


-Dino

-- 
 .~.Dino Morelli
 /V\email: [EMAIL PROTECTED]
/( )\   weblog: http://categorically.net/d/blog/
^^-^^   preferred distro: Debian GNU/Linux  http://www.debian.org


Re: t/src/manifest.t failed

2005-05-17 Thread Leopold Toetsch
Dino Morelli wrote:
I'm seeing the following test failure at r8113
t/src/manifestNOK 6# Failed test (t/src/manifest.t at line 79)
I'd say we just drop this test. Whenever you do reasoanble work in the 
working tree, you got test files, editor swap file and whatnot.

leo


Re: [perl #35305] [PATCH] skip threads 'detatch' test on win32

2005-05-17 Thread Leopold Toetsch
Vladimir Lipsky wrote:
parrot (r8016): no change. hangs w/98% cpu. here's the -t output:
As stated already, this (and possibly other thread) test(s) can't 
succeed as long as Win32 has no event loop that passes the terminate 
event on to the running interpreter.

The last two pmc's are allocated from a place which is clearly not the pmc
pool arena from which other pmc's are allocated.
Run is_pmc_ptr(interp, pmc) or check the involved pmc arenas to verify 
this assumption.

leo