7 messages in com.perforce.perforce-user[p4] What is the best scripting langu...
FromSent OnAttachments
Jeffrey Jacobson04 Dec 2002 09:46 
Jeremy Russell04 Dec 2002 10:11 
J. Bowles04 Dec 2002 10:46 
Bennett, Patrick04 Dec 2002 11:02 
Chris Patti04 Dec 2002 12:57 
Jeffrey Jacobson04 Dec 2002 20:14 
Yariv Sheizaf04 Dec 2002 23:49 
Subject:[p4] What is the best scripting language for Perforce?
From:Jeffrey Jacobson (je@planetjeff.net)
Date:12/04/2002 08:14:46 PM
List:com.perforce.perforce-user

Thanks for all the feedback!

Based on what you-all have told me and my checking around, I'm leaning toward using Ruby. It allegedly has most of the advantages of Perl and Python and being truly object-oriented to boot. I especially like the fact that the W3C consortium is heavily involved with it and it works with XML and other web stuff.

The only downside that really worries me leaving my employer's with scripts they eventually can't get anyone to support. On the other hand, the scripts I will write for them will be very simple, and any scripter worth his salt could just rewrite them if Ruby doesn't catch on.

At 12:46 PM 12/4/2002 -0500, you wrote:

I want to write some stand-alone scripts to do simple P4 operations, but later on, I want to make them web-accessable and (probably) more complex. Would you reccommend:

Java? Perl? PHP? something else?

I guess this is a religious question.

Oh, yes. Quite so.

I think that the strongest point that we could all agree on, well, many of us could, is that you want a "scripting" language that supports quick modifications and testing and the like. Most compiled languages will be too cumbersome (make sure compiler's installed, runtimes, everything) to make 'hack and rerun' an option.

That's an argument for Perl, Python, Ruby, and VERY LIGHTWEIGHT Java applications that can be quickly recompiled. (Personally, any string-manipulation task - and most build/release things are - should not include count-by-bytes manipulation of strings to find the '/' in position 13 and so on. So if you use C/C++/Java, you have to have library routines/methods to make that aspect really easy.)

Me? I use Perl for quickies, and Python for longies.

-jab

ps. And the DOS command interpreter doesn't do things like loops and if/then/else well enough to program in for anything but one-liners, so I would avoid it at any cost. Perl's free and downloadable, so is Python, and the staff-time cost of debugging/using .bat/.cmd doesn't seem worth it to me.

pps. If you come up with an approach for a seemingly-heavyweight language (C, C++, Java) that feels slick and nice to you, PLEASE share it and let us know!

Date: Wed, 4 Dec 2002 13:10:48 -0500 From: Hamish Macdonald <hamish at tropicnetworks.com> To: Jeffrey Jacobson <jeff at planetjeff.net> Subject: RE: [p4] What is the best scripting language for Perforce?

I've been quite happy with python. I've built some fairly complex incremental build-testing scripts with a web-access component.

Regards, Hamish.

Date: Wed, 4 Dec 2002 10:11:29 -0800 From: Jeremy Russell <jrussel at reshape.com> To: 'Jeffrey Jacobson' <jeff at planetjeff.net>, perforce-user at perforce.com Subject: RE: [p4] What is the best scripting language for Perforce?

I very much prefer Perl and the Perl Perforce API.

However, for truly beautiful code, try Ruby. IMHO, Ruby does everything right that Python attempted fix over Perl. Ruby is pretty cool and fun to use. If more companies used Ruby I would most likely switch, but alas, my scripts have to be supportable by the masses and thus Perl is my standard.

There is a Ruby Perforce API as well.

-----------*----------------*---------- Jeremy Russell Buildmeister ReShape,Inc. jrussel at reshape.com W: 650.230.3202 F: 650.230.3220

Date: Wed, 4 Dec 2002 14:03:18 -0500 From: "Bennett, Patrick" <Patrick.Bennett at inin.com> To: J. Bowles <jab at piccoloeng.com>, Jeffrey Jacobson <jeff at planetjeff.net> Cc: perforce-user at perforce.com Subject: RE: [p4] What is the best scripting language for Perforce?

[ The following text is in the "iso-8859-1" character set. ] [ Your display is set for the "US-ASCII" character set. ] [ Some characters may be displayed incorrectly. ]

-----Original Message----- From: J. Bowles [mailto:jab at piccoloeng.com]

Definitely a religious question, but I'd have to whole-heartedly recommend Ruby (so would the author of the Ruby API's ;>) I've had to write about 250K of Ruby scripts for our company's use of Perforce and it's been working extremely well.

_______________________________________________ perforce-user mailing list - perforce-user at perforce.com http://maillist.perforce.com/mailman/listinfo/perforce-user

Date: Wed, 04 Dec 2002 15:58:18 -0500 From: Chris Patti <cpatti at atg.com> To: Jeffrey Jacobson <jeff at planetjeff.net>, perforce-user at perforce.com Subject: Re: [p4] What is the best scripting language for Perforce?

I guess this is a religious question. ;-)

-- Jeff http://PlanetJeff.net

Kind of :)

Top three candidates:

Perl Python Ruby

All these languages have excellent, supported API's provided by Perforce. Unfortunately, you need to custom build a version of the interpreter in question with the Perforce .so's linked in, but this may not be a problem for you.

As to which of the three to pick, all are winners - I prefer Ruby and think it's the most advanced and expressive language of the lot but that's just my highly flame-ridden opinion :)

-- Jeff http://PlanetJeff.net