I know there are some (reformed?) perl hackers among the Lisp community
- Peter Seibel, Daniel Barlow . . . - and Lisp users care more about
interactive programming environments than perl users,so I figured this
was a good place to ask: What do / would you guys use for interacting
with Perl?
Note that i'm mostly curious about how to shorten the
edit/compile/debug cycle and 'ask questions' of a running program. The
perl debugger and psh feel clunky by comparison with lisp, ruby, or
even python, but perhaps i'm missing something.
-cody
··············@gmail.com" <·············@gmail.com> writes:
> I know there are some (reformed?) perl hackers among the Lisp community
> - Peter Seibel, Daniel Barlow . . . - and Lisp users care more about
> interactive programming environments than perl users,so I figured this
> was a good place to ask: What do / would you guys use for interacting
> with Perl?
>
> Note that i'm mostly curious about how to shorten the
> edit/compile/debug cycle and 'ask questions' of a running program. The
> perl debugger and psh feel clunky by comparison with lisp, ruby, or
> even python, but perhaps i'm missing something.
I asked this question and was taught the magic incantation
perl -e 'print "\n> "; while(<>){print eval($_) . "\n> ";}'
which gives you a Perl repl to type at. I then concentrated
on learning CL and failed to study Perl at all, so I've no
idea how useful this is in practise
Alan Crowe
Edinburgh
Scotland
Alan Crowe <····@cawtech.freeserve.co.uk> writes:
> ··············@gmail.com" <·············@gmail.com> writes:
> > I know there are some (reformed?) perl hackers among the Lisp community
> > - Peter Seibel, Daniel Barlow . . . - and Lisp users care more about
> > interactive programming environments than perl users,so I figured this
> > was a good place to ask: What do / would you guys use for interacting
> > with Perl?
> >
> > Note that i'm mostly curious about how to shorten the
> > edit/compile/debug cycle and 'ask questions' of a running program. The
> > perl debugger and psh feel clunky by comparison with lisp, ruby, or
> > even python, but perhaps i'm missing something.
>
> I asked this question and was taught the magic incantation
>
> perl -e 'print "\n> "; while(<>){print eval($_) . "\n> ";}'
>
> which gives you a Perl repl to type at. I then concentrated
> on learning CL and failed to study Perl at all, so I've no
> idea how useful this is in practise
That gives you a read-one-line, eval, print loop. Something like:
perl -e '$repl = 1; print "\nPerl> "; while ($repl) { my $in = ""; while(<>) { $in = $in . $_; }; print eval ($in), "\n";}'
gives you a tiny bit more friendly repl -- at least you don't have to
type everything on one line -- you can indicate an expression is
finished by sending an EOF (C-c C-d in Emacs). Gee, languages with a
read function make this a bit easier. Adding something equivalent to
* ** *** + ++ +++ is a good idea, too.
If you go down this route, you'll probably end out Greenspunning a
proper(ish) REPL, a better debugger, and reinventing ILISP. Not that
there's anything terribly wrong with that. It's a far, far cry from a
reasonable language like Lisp or Smalltalk, but you will get a level
of interactivity that is a lot more productive than the typical perl
development model.
--
/|_ .-----------------------.
,' .\ / | Free Mumia Abu-Jamal! |
,--' _,' | Abolish the racist |
/ / | death penalty! |
( -. | `-----------------------'
| ) |
(`-. '--.)
`. )----'
On 2005-12-05, ·············@gmail.com <·············@gmail.com> wrote:
> I know there are some (reformed?) perl hackers among the Lisp
> community - Peter Seibel, Daniel Barlow . . . - and Lisp users care
> more about interactive programming environments than perl users,so I
> figured this was a good place to ask: What do / would you guys use
> for interacting with Perl?
I use (what I consider to be) a more appropriate tool -- in this case,
development methodology -- for the job. I use Test Driven
Development. See _Perl Testing_
(http://www.amazon.com/gp/product/0596100922) and _Test Driven
Development_ (http://www.amazon.com/gp/product/0321146530). Read both
online at safari.oreilly.com.
But I'm more of a Perl guy than a Lisp guy, so maybe Peter & Daniel
have better answers. :)
-- Larry
Larry Clapp <·····@theclapp.org> writes:
> But I'm more of a Perl guy than a Lisp guy, so maybe Peter & Daniel
> have better answers. :)
Not me. It's been a long time since I hacked Perl in anger.
-Peter
--
Peter Seibel * ·····@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
Larry Clapp wrote:
> I use (what I consider to be) a more appropriate tool -- in this case,
> development methodology -- for the job. I use Test Driven
> Development.
I was originally inclined to dismiss this as orthogonal to the REPL
issue, but it clearly seems to be the way the perl community has chosen
to deal with workflow / interactivity. After playing with it more,
test-first + perldb from emacs is workable - you can load a test file
into the debugger and still poke around with trying out statements,
printing values, and dumping structures. Not quite the same as
incrementally adding things to a live image as with lisp or ruby, but
now I actually like it a bit better than the last time I used python's
repl, at least with regards to keeping changes to modules loaded and in
sync.
as far as books go, http://www.apress.com/book/bookDisplay.html?bID=399
actually seemed more relevant - it has at least one chapter devoted to
using the debugger as a shell.
-cody
[ Posted & mailed ]
On 2005-12-08, ·············@gmail.com <·············@gmail.com> wrote:
> Larry Clapp wrote:
>> I use (what I consider to be) a more appropriate tool -- in this
>> case, development methodology -- for the job. I use Test Driven
>> Development.
>
> I was originally inclined to dismiss this as orthogonal to the REPL
> issue, but it clearly seems to be the way the perl community has
> chosen to deal with workflow / interactivity.
Yeah, it's unfortunate (from the Lisper's point of view) -- especially
considering that Perl has read (sort of)[1], eval, print, and loop --
but it does actually work fairly well when you give it an honest try.
> as far as books go,
> http://www.apress.com/book/bookDisplay.html?bID=399 actually seemed
> more relevant - it has at least one chapter devoted to using the
> debugger as a shell.
Thanks for the link!
-- Larry
[1] By which I mean that you can input text, but you can't input a
complete expression with one built-in function call.
5 Dec 2005 09:16:47 -0800 skrev ·············@gmail.com:
[snip]
> was a good place to ask: What do / would you guys use for interacting
> with Perl?
>
> Note that i'm mostly curious about how to shorten the
> edit/compile/debug cycle and 'ask questions' of a running program. The
> perl debugger and psh feel clunky by comparison with lisp, ruby, or
> even python, but perhaps i'm missing something.
wild guess: perl is not the right tool for your job.
python combined with ipython may be a better option ( but of course, does
not answer your question).
--
Mandus - the only mandus around.
On 5 Dec 2005 09:16:47 -0800,
··············@gmail.com" <·············@gmail.com> wrote:
> Note that i'm mostly curious about how to shorten the
> edit/compile/debug cycle and 'ask questions' of a running
> program. The perl debugger and psh feel clunky by comparison
> with lisp, ruby, or even python, but perhaps i'm missing
> something.
I usually load Perl scripts in the perl debugger within Emacs.
Having the full power of an Emacs editing buffer on top of the
Perl debugger is very nice.