Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chromatic (983)

chromatic
  (email not shown publicly)
http://wgz.org/chromatic/

Blog Information [technorati.com] Profile for chr0matic [technorati.com]

Journal of chromatic (983)

Thursday August 16, 2007
04:12 PM

But Seriously Cosine, Just Define the Freakin' Term Already!

[ #34133 ]

I suspect the reason many Perl enthusiasts do not agree is that they have never written a language-powered DSL in an appropriate situation. If the most vocal Perl users (and their leadership, too?) is lambasting the idea, they certainly have no small social obstacle to get around if they honestly think the language-powered DSL is the right way to go.

Cosine Jeremiah, Why Use a Language-Powered Domain Specific Language?

I'm lambasting the idea that, because Ruby lets you slap colons on the front of words and call methods without wrapping their arguments in parenthesis, you're somehow the Mayor For Life of Deeesselltown. Woo. Party time.

Honestly, I can't tell what the difference is between an API (How old school, you crotchety old Perl programmers are still writing APIs? I bet you ride your dinosaur to school uphill both ways in the snow, don't you GRAMPA!) and a DSL (Ruby will buy you a hoverbike. Ruby loves you. Ruby makes its own gravy.), except that maybe somehow string-eval is the magic pixie dust that require or use (Gah! How '90s! Totally tubular old dude!) or do (WTF?! I don't see code blocks anywhere! LOLLERS lrn 2 program!!) isn't.

So, yeah, if you could explain precisely what a DSL is, maybe I could understand it. (As a programmer, I write and use APIs all day, and they look pretty dang similar, except that I don't use string-eval.)

I think you had a brilliant chance to talk about maintainability, the use of ubiquitous language, domain driven design, simplicity, and usability of interface, but instead you grabbed for the new bright and shiny. (Perhaps I'm just a dinosaur, but Aristotle isn't convinced either, and he's smart.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • In some ways, this debate is like the one over the difference between languages and dialects with human languages. I would say that something that determines a domain-specific language vs a dialest is having a separate existence. Is the DSL defined separately from the parent language? Could it be parsed by another parser without the complete interpreter for the parent language? Or is just a convention and API to represent the domain? A good example is JSON. JSON started out as JavaScript, but was spec
    • That’s an amalgamation of the point made by Piers Cawley [bofh.org.uk] and some by Ovid [perl.org].

      I think this is a discussion with lots of distinctions without a difference. It’s like we’re trying to define what pornography is.

    • Or is just a convention and API to represent the domain?

      Obviously it can't be that, or you could write DSLs in Perl, which Cosine suggested is impossible.

      My main objection is that the whole mad-foaming rush to drool over three little letters so overshadows much more interesting discussions, such as:

      • To what degree do general purpose programming language design issues affect expressibility?
      • To what degree does the expressibility of your programming language affect the robustness and ease of produci
      • > "You have access to the full syntax and semantics of the
        > host language as an escape hatch; why not take advantage of that?"

        One of the nicer things about Module::Install (lets ignore the whole fundament disagreement over the concept for a moment) is the nice little DSL (\o/ yay \o/) it uses, and the fact you CAN mix the regular language in with it.

        use inc::Module::Install;

        name 'foo';
        all_from 'lib/foo.pm';
        requires 'Bar' => 1.01;
        build_requires 'Test::More' => 0.42;

        if ( $ENV
        • Does this meet the criteria for a DSL?

          $ perl -MO=Deparse is_it_a_dsl.pl
          use inc::Module::Install;
          name('foo');
          all_from('lib/foo.pm');
          requires('Bar', 1.01);
          build_requires('Test::More', 0.42);
          if ($ENV{'AUTOMATED_TESTING'}) {
              build_requires('Test::Pod');
          }
          WriteAll();
          - syntax OK

          It's as much a DSL as any other API where you leave off parentheses. In my book, that's a "no".

        • Almost: it’s not Ruby.

        • To the extend that omitting all the parentheses and pointy bits makes it just an obfuscated form of perl, no.

          • Obfuscated…?

            • Well sure. Anytime you go taking parentheses and pointy bits off function and method calls you introduce ambiguity about what the invocant is, what the method or function name is and what its parameters are.