develooper Front page | perl.perl5.porters | Postings from August 2008

B, B::Utils and friends - export c functions for other xs modules

Thread Next
From:
Chia-liang Kao
Date:
August 14, 2008 00:53
Subject:
B, B::Utils and friends - export c functions for other xs modules
Message ID:
46C171FD-E850-4408-99AE-3FE6690DB8DB@bestpractical.com
Hi,

As some of you might have known, yuval and I have been hacking some B  
related stuff.  One of the problems is that we need to copy and paste  
a lot of static function scattered around from B, B::Generate.  This  
is bad.  I found ExtUtils::Depends kind of solves this problem.

I chatted with jjore on irc a while ago, about putting some of the  
useful c functions into B::Utils, so we can reuse them.

http://svn.jifty.org/svn/jifty.org/B-Utils

currently it has 3 functions:

extern char *BUtils_cc_opclassname(pTHX_ const OP *o);
extern SV *BUtils_make_sv_object(pTHX_ SV *arg, SV *sv);
extern I32 BUtils_op_name_to_num(SV * name);

The current use of it are B::OP::Util and B::OPCheck, which can be  
found in the same repository.

I plan to put some more useful stuff in, such as upcontext from  
Want.xs (which actually comes from B.xs), so this comes to if we  
should just patch B that way and export those functions.

another thing is that currently the B ext in the perl tree is actually  
a mix of everything.  Things like B-Deparse, B-C, are not really tied  
to B, but just uses it.  should it (and can it) be splited into  
different dist under ext/ ? I think we just need to make sure the test  
ordering and INC when running tests.

Cheers,
CLK


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About