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
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!