You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by pw...@mdtsoft.com on 2003/01/23 15:12:01 UTC
Perl bindings for Subversion using SWIG
I would like to work on a set of perl bindings for subversion.
the obvious way to do this is to use swig (at least I think that it is
obvious). Before I begin I would like to ask two questions of the list:
1) Is anyone already working on perl bindings, if so can you share the
work with me.
2) Any hints or pitfalls that I should look out for. I have used perl
in production for over 14 years (some of the code from 1989/10/19
is still in use, just checked the CVS Logs) but I have not used SWIG
before. I also don't use the GNU configure tools much so any hints
on that would be usefull.
--
It is MDT, Inc's policy to delete mail containing unsolicited file attachments.
Please be sure to contact the MDT staff member BEFORE sending an e-mail with
any file attachments; they will be able to arrange for the files to be received.
This email, and any files transmitted with it, is confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please advise postmaster@mdtsoft.com
mailto:postmaster@mdtsoft.com.
Philip W. Dalrymple III pwd@mdtsoft.com
MDT Software - The Change Management Company
+1 678 297 1001
Fax +1 678 297 1003
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by Greg Stein gs...@lyra.org.
On Fri, Jan 24, 2003 at 08:29:49AM -0500, pwd@mdtsoft.com wrote:
On 23 Jan, Rafael Garcia-Suarez wrote:
pwd@mdtsoft.com wrote:
I would like to work on a set of perl bindings for subversion.
Great !
I'll echo that. People have said in the past they'd like to work on them,
but we haven't seen anything yet. There certainly isn't a worry that you're
duplicating effort (the last I heard was way back in July).
the obvious way to do this is to use swig (at least I think that it is
obvious).
Obvious in the way that other languages bindings for Subversion are
done via SWIG. However SWIG isn't much used in the Perl world, where
XS (the native extension mechanism) and Inline::C are more widely
supported. XS is arguably difficult to use, but Inline::C is very
simple.
I heard the same thing. Oh, use XS instead of SWIG. Perl users don't like
SWIG. But the people who said that to me didn't follow up with XS, so I say
fooey on them.
IMO, SWIG is going to be the fastest way to get bindings. Assuming that the
SWIG Perl stuff is working great, then these bindings should work just
great, XS be damned :-)
I have used XS some but as the swig xxx.i files are already written
it looks like swig should be not too hard.
If you're at all familiar with writing Perl extensions, then yes, it
shouldn't be too hard.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by Dave Rolsky au...@urth.org.
On Mon, 27 Jan 2003, Greg Stein wrote:
If you aren't an expert with either SWIG or XS my guess is that Inline::C
is probably the easiest way to do this. Of course, I idly tried working
on a Subversion wrapper using Inline::C, and I got nowhere. But I really
don't know much about C, and I didn't try all _that_ hard.
I'm not familiar with Inline::C, but get the impression it is about
inserting C code into Perl code? Does that mean you would have to manually
write a Perl function for each SVN function you want to expose? And then
update those mapping functions every time we change the SVN API?
How, um... tedious... :-)
Yeah, that would be, but it's not like that. Actually, Inline
automatically makes C functions available at the Perl level.
Of course, you might want to write some Perl level code to make the API
more Perl-ish. In fact, one of the great sins of some Perl-wrapping-C
code, IMHO, is to _simply_ wrap the C interface and present it as is.
That makes for a really bad Perl interface.
But this is getting OT.
-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by Greg Stein gs...@lyra.org.
On Fri, Jan 24, 2003 at 06:14:34PM -0600, Dave Rolsky wrote:
On Fri, 24 Jan 2003 pwd@mdtsoft.com wrote:
I have used XS some but as the swig xxx.i files are already written
it looks like swig should be not too hard.
Yes and no. You still have to write the Perl-specific SWIG stuff, which
is the hard part. Take a look at the existing swig files and you'll see
that most of the ugly stuff is language-specific (Python, Java).
Right. You teach SWIG how to map between Subversion types and the languages'
types. For example, how to convert Subversion's svn_string_t to and from
Perl's string type.
If you aren't an expert with either SWIG or XS my guess is that Inline::C
is probably the easiest way to do this. Of course, I idly tried working
on a Subversion wrapper using Inline::C, and I got nowhere. But I really
don't know much about C, and I didn't try all _that_ hard.
I'm not familiar with Inline::C, but get the impression it is about
inserting C code into Perl code? Does that mean you would have to manually
write a Perl function for each SVN function you want to expose? And then
update those mapping functions every time we change the SVN API?
How, um... tedious... :-)
My guess that the really hard part is simply grokking the subversion API,
and understanding what needs exposure to Perl and what doesn't.
That is where the existing .i files come in. They define a subset of the API
which is interesting to other languages. For example, they don't expose
much of APR since (presumably) the languages all have their own portable
equivalents of that functionality. And they don't expose string functions
since (again) the languages are assumed to have ample string facilities.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by pw...@mdtsoft.com.
On 24 Jan, Dave Rolsky wrote:
On Fri, 24 Jan 2003 pwd@mdtsoft.com wrote:
I have used XS some but as the swig xxx.i files are already written
it looks like swig should be not too hard.
Yes and no. You still have to write the Perl-specific SWIG stuff, which
is the hard part. Take a look at the existing swig files and you'll see
that most of the ugly stuff is language-specific (Python, Java).
Well I started with the swig over the weekend. I was able to generate
the *wrap*.c file but am still working on getting it to compile.
The typemap stuff in SWIG is not much different from XS so my bigest problem
will be understanding some of the APIs for subversion, in addtion to not
having enough time to work on this.
I have a MakeMaker file started but it is not yet able to generate a Makefile
that will compile the code.
If you aren't an expert with either SWIG or XS my guess is that Inline::C
is probably the easiest way to do this. Of course, I idly tried working
on a Subversion wrapper using Inline::C, and I got nowhere. But I really
don't know much about C, and I didn't try all _that_ hard.
My guess that the really hard part is simply grokking the subversion API,
and understanding what needs exposure to Perl and what doesn't.
-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
--
It is MDT, Inc's policy to delete mail containing unsolicited file attachments.
Please be sure to contact the MDT staff member BEFORE sending an e-mail with
any file attachments; they will be able to arrange for the files to be received.
This email, and any files transmitted with it, is confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please advise postmaster@mdtsoft.com
mailto:postmaster@mdtsoft.com.
Philip W. Dalrymple III pwd@mdtsoft.com
MDT Software - The Change Management Company
+1 678 297 1001
Fax +1 678 297 1003
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by Dave Rolsky au...@urth.org.
On Fri, 24 Jan 2003 pwd@mdtsoft.com wrote:
I have used XS some but as the swig xxx.i files are already written
it looks like swig should be not too hard.
Yes and no. You still have to write the Perl-specific SWIG stuff, which
is the hard part. Take a look at the existing swig files and you'll see
that most of the ugly stuff is language-specific (Python, Java).
If you aren't an expert with either SWIG or XS my guess is that Inline::C
is probably the easiest way to do this. Of course, I idly tried working
on a Subversion wrapper using Inline::C, and I got nowhere. But I really
don't know much about C, and I didn't try all _that_ hard.
My guess that the really hard part is simply grokking the subversion API,
and understanding what needs exposure to Perl and what doesn't.
-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by pw...@mdtsoft.com.
On 23 Jan, Rafael Garcia-Suarez wrote:
pwd@mdtsoft.com wrote:
I would like to work on a set of perl bindings for subversion.
Great !
the obvious way to do this is to use swig (at least I think that it is
obvious).
Obvious in the way that other languages bindings for Subversion are
done via SWIG. However SWIG isn't much used in the Perl world, where
XS (the native extension mechanism) and Inline::C are more widely
supported. XS is arguably difficult to use, but Inline::C is very
simple.
I have used XS some but as the swig xxx.i files are already written
it looks like swig should be not too hard.
What's your final goal ? IOW for what purpose are you using this ?
My first goal is to get the basic client api avaiable from perl.
I need to build a special checkin script that will run on both windows
and unix that will require the user input both a comment and a eco
(Engineering Change Order, think bugzilla) number to do a commit.
The other thing that I need to do is build a robust system that will
be triggered by a hook script and will.
1) update a special working copy seeing what has been changed.
2) check each of the modified (updated) files to see if they meet
our coding standards and if not fix them;
perltidy, indent and inserting copyright notices for example.
3) attach mime-types if missing and enable keyword expansion.
4) if any changes where needed to the file then commit the changes with
a good comment AND e-mail the person who did the work that they
need to update there wc.
Before I begin I would like to ask two questions of the list:
1) Is anyone already working on perl bindings, if so can you share the
work with me.
I don't think so.
--
It is MDT, Inc's policy to delete mail containing unsolicited file attachments.
Please be sure to contact the MDT staff member BEFORE sending an e-mail with
any file attachments; they will be able to arrange for the files to be received.
This email, and any files transmitted with it, is confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please advise postmaster@mdtsoft.com
mailto:postmaster@mdtsoft.com.
Philip W. Dalrymple III pwd@mdtsoft.com
MDT Software - The Change Management Company
+1 678 297 1001
Fax +1 678 297 1003
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by Rafael Garcia-Suarez rg...@free.fr.
pwd@mdtsoft.com wrote:
I would like to work on a set of perl bindings for subversion.
Great !
the obvious way to do this is to use swig (at least I think that it is
obvious).
Obvious in the way that other languages bindings for Subversion are
done via SWIG. However SWIG isn't much used in the Perl world, where
XS (the native extension mechanism) and Inline::C are more widely
supported. XS is arguably difficult to use, but Inline::C is very
simple.
What's your final goal ? IOW for what purpose are you using this ?
Before I begin I would like to ask two questions of the list:
1) Is anyone already working on perl bindings, if so can you share the
work with me.
I don't think so.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl bindings for Subversion using SWIG
Posted by Josef Wolf jw...@raven.inka.de.
On Thu, Jan 23, 2003 at 10:12:01AM -0500, pwd@mdtsoft.com wrote:
I would like to work on a set of perl bindings for subversion.
the obvious way to do this is to use swig (at least I think that it is
obvious). Before I begin I would like to ask two questions of the list:
I am tempted to dive into perl bindings. I have expirience with XS
bindings, therefore my first thoughts were directed into XS. I have
_no_ expirience with swig. But now, that I have read the intro on the
swig homepage, I got the impression that going XS would be a bad
choice in the long run. I am not sure whether I got it correctly, but
I got the strong feeling that I _need_ to learn more about swig...
Summary:
- I would like to [have|do] perl-bindings.
- I can [help|do] XS bindings.
- I am not sure whether XS is the way we want to go.
- I have (yet) not much clue about swig, and I do not know when I
will have the time to learn more about it.
--
-- Josef Wolf -- jw@raven.inka.de --
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org