On Tue, Apr 12, 2011 at 5:56 PM, Chad Perrin <code / apotheon.net> wrote:
>
>> 'Domain Specific Language' is a perjorative term.
>
> No -- it's a descriptive term. =A0A pejorative term would be something li=
ke
> "blub language". =A0The term "domain specific language" describes a
> narrower focus, which makes it more suitable to certain tasks than a
> domain nonspecific language, and less suitable to other tasks.
>
> You act as though "domain specific" is a synonym for "crippled", but
> that's not the case at all.

To elaborate:

I'm a heavy user of TADS 3 these days, which stands for "Text
Adventure Development System".

It has a heavily C influenced syntax, is Turing complete, and is
compiled into bytecode, but I wouldn't dream of using it to script
regular tasks with it, or write a spreadsheet in it. It's standard
library is heavily geared towards text adventures (what a surprise),
and has next to no functions to call up files, since the IF
interpreter takes care of loading and saving game state.

It has syntax features and objects that make writing interactive
fiction a breeze, however.

For example:

aRoom: Room 'room noun' 'room name'
  "This is a room. "
;

+desk: Table 'table noun' 'table name'
  "A table with four legs. "
;

++paper: Readable, Thing 'readable noun' 'readable name'
  "A piece of paper. "
  readDesc =3D "You read what's written on the piece of paper. "
;

Each plus is an instance of "object nesting": The piece of paper is on
a table, in a room, and the player can react to the things in the room
by using <verb> <noun> constructs.

If I were to use Ruby for this (and I could), I'd still be writing a
text parser, instead of doing what I want to do.

TL;DR: DSLs remove a lot of yak shaving for a given task, but
introduce a lot of it when moving outside of the DSL's domain.

It's jargon vs general language: Makes communicating certain ideas
easier to those in the know, than using a general purpose language.

--=20
Phillip Gawlowski

Though the folk I have met,
(Ah, how soon!) they forget
When I've moved on to some other place,
There may be one or two,
When I've played and passed through,
Who'll remember my song or my face.