From: Fergal Daly (fergal at domain esatclear.ie)
Date: Tue 31 Jul 2001 - 15:37:59 IST
On Tue, Jul 31, 2001 at 01:29:01PM +0100, Harry Moreau wrote:
> Definitely not with C/C++. While fast, it's just too difficult to parse
> text in a bug free manner.
>
> As an alternative to perl, you might consider tcl or python, which are IMO
> much easier to learn than perl.
>
> Both have much more regular syntax than perl and are either intrinsically
> or extensionally object oriented; python intrinsically and tcl with the
> [incr tcl] extension. Furthermore both python and tcl are very easy to
> extend with new functionality implemented in C/C++, because they were
> designed to be embedded languages.
Just in case anyone was beginning to doubt it, Perl also has an incredibly
flexible object system as a core feature of the language. This includes
dynamic method creation/dispatch, dynamic class creation and even
"multi-method" dispatch - where you select the correct method based on the
class of more than 1 of the objects involved.
While I'm at it, Perl is not only embeddable and extensible but it has the
exteremly funky Inline module which lets you include bits of C in your Perl
programs and call them as if they were just perl functions.
use Inline C => << 'END_OF_C';
void japh(char *x) {
printf("Just another %s hacker\n", x);
}
END_OF_C
foreach my $lan (qw( Perl C))
{
japh($lang);
}
The C will be dynamically recompiled only if you haven't changed the C code
since the last time. It's not just a gimmick, you can access shared
libraries and the whole shooting gallery with this. See
http://search.cpan.org/doc/INGY/Inline-0.43/C/C-Cookbook.pod
for a bunch of examples.
People often talk about coding in high level languages but doing the high
performance bit in C or assembler. It's not going to get any easier than
this!
Fergal
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:11:24 GMT