Making D better than other programming languages (warning: rant, drivel)

LaggedOnUser laggedonuser at gmail.com
Sun Oct 29 08:26:06 PST 2006


Thanks for your reply.  I checked out the Google video and it was very interesting.

In the video, David Pollack described a number of DSLs including:
* SQL
* PostScript
* PDF
* XML
* HTML
* Spreadsheet macro

It occurred to me also that any data file format could be considered a "domain specific language" as well, for example, the format of a GIF file or CSV
text file.  If that definition were accepted, then the number of DSLs could be said to be in the thousands, in addition to custom DSLs.

DSLs seem to fall into two basically different categories:
1. Data Definition (declarative) languages such as SQL, PostScript, PDF, XML, HTML...
2. Program Definition (procedural) languages such as Spreadsheet macro, other DSLs...

How does this affect the promotion of the DMD language?  It seemed to me in two ways:
1. DSLs require a good "glue language", for which purpose David recommended Ruby.  All of the glue languages I have ever seen recommended (Ruby, Perl,
Python, etc.) are all without exception high-level scripting languages.  Therefore, DMD is probably not a "glue language" as it currently stands.
2. DSLs, particularly of a Data Definition kind, require an interface.  Your programming language of choice should be able to read and write XML
fluently, for example.  Most programming languages can do that.

Point #1 seems to confirm my notion that for DMD to be useful as a DSL language there should be a D-compatible scripting language.  This could be
programmed from scratch or possibly implemented on top of the new Parrot shared-language infrastructure for maximum compatibility with existing
languages such as the Perl 6 (and whatever else they implement on top of Parrot).  This could extend D's reach into the DSL area.

Point #2 seems to imply that a large library of DSL reading and writing functions would be useful.  That is, if D could natively read audio, graphic,
and video file formats, as well as PDF, XML, HTML, etc, that would make the language very attractive as well.

As for the Program Specific languages, I am somewhat suspicious of their usefulness.  Even David in his video mentions that programmers were reluctant
to learn a new language, Click, just to program in some application domain.  The burden of learning a new syntax for web scripting, browser scripting,
programming, etc. is already great enough without creating any number of new incompatible syntaxes, and the benefits of syntax redefinition are
probably not that great.  That would fragment the development base even worse than it already is.  It would probably be better for programmers in my
opinion to simply adapt some general purpose, already-proven and debugged language to be the scripting language of their project than to invent a new,
incompatible scripting language for no great purpose.  The syntactic domain is already well-explored and probably holds few surprises.

LaggedOnUser



More information about the Digitalmars-d mailing list