Lambda the Ultimate

inactiveTopic Perl as a community DSL
started 12/30/2003; 8:51:46 PM - last post 1/4/2004; 8:24:15 AM
Adam Keys - Perl as a community DSL  blueArrow
12/30/2003; 8:51:46 PM (reads: 160, responses: 4)
I was reading from the new _Spidering Hacks_ book and got to thinking about Perl's 'funky' nature. I got to wondering whether it was a language that allowed people to program in their own 'personal DSL' or 'personal LL' and then wondered if maybe Perl is just a mish-mash of the core developers own DSLs. I jotted my thoughts down here:

http://trmk.org/~adam/blog/archive/000454.html

Hope you find it interesting.

andrew cooke - Re: Perl as a community DSL  blueArrow
12/31/2003; 3:27:38 PM (reads: 137, responses: 0)
it's a nice way of looking at things.

normally you're not only using just one DSL, but only have access to that one DSL. in the case of Perl, as you describe it, it seems to me that much of "the problem with perl" comes from those different DSLs not being well defined / bleeding into one-another.

maybe (i suspect so, at least in perl 6) there's some way to restrict what parts of the language are available. then you could take base perl and restrict it to the domain you're interested in for a particular module. different modules could interact since they're in the same base language and the glue layer could be "full" Perl.

Adam Keys - Re: Perl as a community DSL  blueArrow
12/31/2003; 4:17:33 PM (reads: 129, responses: 1)
The restricted subsets of Perl sounds very interesting. I suppose I can read about this in one of the Apocalypses or the accompanying documents? Also, I think you've got a good point about the different mini-languages 'bleeding' into each other. Its enough to *almost* tempt me to learn Perl. But not quite :)

andrew cooke - Re: Perl as a community DSL  blueArrow
12/31/2003; 6:09:58 PM (reads: 127, responses: 0)
it was just a guess, i don't know if it's possible.

Mitchell N Charity - Re: Perl as a community DSL  blueArrow
1/4/2004; 8:24:15 AM (reads: 87, responses: 0)
Macros are a powerful language feature, but some languages (eg, Java) explicitly leave them out because of their social cost (balkanizing dialects, and too much rope for the clueless to create horrors).

In comparing Perl and Python, one observation which gets made is that Perl's rich hairiness provides useful power and avoids "you can't get there from here" problems which one sometimes encounters in Python, especially when doing DSLs. But Python's restrictions provide a minimum floor on bad taste, which much Perl code plumbs deeply.

Now, Java tools have developed for further restricting programming style. Style checkers on steroids. This or that syntactic or semantic construct can or can't be used in this or that situation.

So one might imagine creating a Perl style analyzer, and defining a "good taste Perl style" which one should default to when there isn't a reason not to. This has happened socially to some limited extent. I suspect it hasn't yet happened more, more for cultural rather than for technical reasons. Or perhaps simply no one has yet gotten around to it.

Which raises the language design question. Is one better off creating a language which restricts abuse and use, or creating a language in which anything goes, and then defining culturally-acceptable testable subsets for everyday use?