[boulder.pm] Gathering anyone?

Jim Baker boulder-pm at jim-baker.com
Mon Nov 5 19:11:25 CST 2001


Exactly.  One can do this.  But this is also a reason many of us like to use
Perl instead of Lisp.  After all if we did write our code in Lisp, we could
use the fact that code is data, and this means we can write powerful macros
w/o having a parser.  But for some reason (except of course for our Emacs
macros) we don't.

So why make this compromise?  Part of this is that the habits of language
can be useful.  Larry Wall has opined on this quite a bit.  Now I can't make
Rob accept the whole argument; he's not exactly a TMTOWTDI partisan ;) But
surely there's something to be said that syntax can help us arrive at
correct code more easily.

Now here's a question for our fellow mongers:  Assume my premise that
embedded little languages might be useful.  What would you like?  I could go
for a tighter integration with SQL, more so than the awkwardness of
DBIx::Recordset or the procedural overhead of DBI.  (Yes, you can use maps
and hash slices.  I do.  But.)

- Jim

-----Original Message-----
From: owner-boulder-pm-list at pm.org
[mailto:owner-boulder-pm-list at pm.org]On Behalf Of Rob Nagler
Sent: Monday, November 05, 2001 2:24 PM
To: boulder-pm-list at happyfunball.pm.org
Subject: RE: [boulder.pm] Gathering anyone?


> closures as callbacks).  Look at the Tk interface, for example.

Or bOP, which uses little languages extensively, but then you know
that already, Jim. ;-)

> So you'd like to provide a little language where this complexity is hidden
> in the syntax sugar.

I'm not convinced syntactic sugar is necessary.  Lisp has gotten away
without it for almost 50 years.  With clever use of AUTOLOAD (see
Bivio::UI::ViewLanguage as an example), you get a nice clean language.
We use this for testing.  Here's an example:

use strict;
use Bivio::Test;
Bivio::Test->unit([
    'Bivio::Type::CreditCardNumber' => [
	from_literal => [
	    ['4222222222222'] => ['4222222222222'],
	    ['5222222222222227'] => ['5222222222222227'],
	    ['342222222222223'] => ['342222222222223'],
	],
    ],
]);

> Unfortunately, your stand-alone little language
> rapidly gets over whelmed, and you wish you had Perl at your
> disposal.

Time to refactor!

Rob




More information about the Boulder-pm mailing list