That's not a DSL. This is (kinda) a DSL!

Alias on 2009-01-25T16:14:53

After reading a few of chromatic's rants on the Ruby kids trying to redefine the term Domain Specific Language to refer to what is really only a pretty API (but still with a ton of decoration characters) got me thinking.

Ruby isn't the only language where you can have a pretty API.

In fact, I currently look after one of the prettiest APIs in the whole of Perldom myself.

But as someone that's actually worked with some real Domain Specific Languages (like VoiceXML) there's no way in hell I'd want to rise above my station and try to call the Module::Install command syntax a DSL.

But on the other hand...

After reading about this sort of thing for the second or third time, it occurred to me that while Module::Install is merely a "pretty API" it wouldn't be TOO hard to turn it into a REAL Domain Specific Language.

And so that's what I've done.

As well as fixing a few long-standing bugs, the new Module::Install 0.78 also add the new (experimental) Module::Install::DSL.

This module lets you strip off all that inconvenient punctuation and lets you just writes the parts of your M:I Makefile.PL that contains actual information.

And it looks something like this...

use inc::Module::Install 0.78;
use Module::Install::DSL;

all_from lib/ADAMK/Repository.pm requires File::Spec 3.29 requires File::pushd 1.00 requires File::Find::Rule 0.30 requires File::Find::Rule::VCS 1.05 requires File::Flat 0 requires File::Remove 1.42 if win32 requires IPC::Run3 0.034 requires Object::Tiny 1.06 requires Params::Util 0.35 requires CPAN::Version 5.5 test_requires Test::More 0.86 test_requires Test::Script 1.03 install_script adamk

requires_external_bin svn


I'm also pondering the idea of removing all those ugly underscores as well... :)


compatibility and extensibility

ChrisDolan on 2009-01-25T21:39:21

I was about to write a comment worrying that the syntax would have backward compatibility problems and problems with missing features, but then I realized that including the parser in inc/ solves both of those problems.

Hmm, interesting.

Re:compatibility and extensibility

Alias on 2009-01-26T05:12:45

The key benefit to Module::Install is that it doesn't have backwards-compatibility or problems with missing features.

Of course, it has a whole different set of problems, but it does allow me to add and change features without the normal issues that occur in the rest of the toolchain.