[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FWD: Re: Jforum: J, Apache, CGI, Win 98




J and regex vs Perl is FYI.   Bob Ashworth

---------- Original Message ----------------------------------
From: David Ness <DNess@home.com>
Reply-To: forum@jsoftware.com
Date: Fri, 15 Jun 2001 14:32:22 -0400

Alain Miville de Chêne wrote:
>
...
> 
> J with regex is much superior to Perl. 
> 

I'm a little surprised, and wonder if this is just an off-hand remark or a
carefully considered opinion. If it's the former, and just `blowing smoke' then
I won't argue, but if it's a carefully considered opinion, I would like to hear
more, as it is quite contrary to my current view.

I find that a regularly use J, K and perl in just about equal measures, finding each
of them `superior' for some tasks and (clearly) `inferior' for others.

For example, in the experiments I did with `regex' when it was first introduced to
into J, my naive use of J regex was a full order of magnitude slower than my perl. Roger
did his usual magic of writing some `good J' and managed to make J only lose to my perl by 
a factor of 2. I suppose I don't need to point out that Roger's J is distinctly
better code than my perl, so I also don't have much doubt that my perl could also be improved,
thus increasing differential to at least three or four, maybe more.

I also find J's regex very clumsy relative to perl, but that may just be historical accident, as 
I learned my regex stuff back in the late 1960s and perl's formulation is closer to the code
that I first saw in some of Ken Thompson's stuff than is J's approach.

--------------------------------------------------------------------------
For information about the J Forum see http://www.jsoftware.com/j_forum.htm



-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.