News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 7/1/2009 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
A knockout blow for Borland?
MicroFocus has upped its offer for Borland Software to $1.50, hoping to chase off a mystery suitor also pursuing the ALM vendor.
07/06/2009 12:26 PM EST

Is the mystery Borland suitor Serena?
Borland software is considering an offer from another company after a preliminary deal with MicroFocus. Is Serena the new company?
06/30/2009 01:55 PM EST

Windows 7 - An eBayer's dream product?
Windows 7 pre-orders can make people money on eBay.
06/29/2009 03:48 PM EST

 

Microsoft Worldwide Partner Conf.
7/13/2009 to 7/16/2009
New Orleans
Microsoft

OSCON (Open Source Convention)
7/20/2009 to 7/24/2009
San Jose
O'Reilly Media

XBRL Technology Workshop & Summit
7/28/2009 to 7/30/2009
Santa Clara
XBRL US

ACM SIGGRAPH
8/3/2009 to 8/7/2009
New Orleans
ACM SIGGRAPH

OpenSource World (formerly LinuxWorld)
8/12/2009 to 8/13/2009
San Francisco
IDG World Expo


 
Most Read Latest News Blog Resources

Integration Watch: So, you want to write a little language?




October 15, 2008 — 

Writing and implementing a language are nothing new to many computer geeks. University comp-sci curricula regularly require designing and implementing a toy language (complete with a compiler and, these days, a virtual machine).

This exercise often gives programmers a bug that lasts for years: the desire to write and implement their own language. The fantasy often wears off over time, however, diminished by the complexity of the task; the low likelihood that the resultant language would find adoption beyond the developer and a few acquaintances; and, most important, the fact that, aside from a narrow set of personal needs, new languages tend to mimic existing, established ones.

Industry and commerce, however, are a different world altogether. Most large software packages need some kind of little language, or domain-specific language (DSL), to be used for commands, macros and scripting. Regrettably, many DSLs today are designed to use XML syntax in order to facilitate the language parsing. Use of a data interchange format as the defining grammar makes many human-oriented DSLs, such as Ant’s syntax, very unpleasant.

Good DSLs are naturally expressive; that is, their language reflects the problem domain they address. Once such a language is learned, it is easy to remember. A good example is the data and text manipulation language awk. Its syntax is so simple that you can return to it years after you last looked at it and be productive in a few minutes with just a reference card. Of course, awk’s advanced capabilities involve a larger, fuller syntax, but even that retains a remarkable ease of use.

Designing good DSLs or full, expressive languages is no easy job. And yet, it is the design stage that frequently will determine a language’s appeal. For example, a substantial part of Ruby’s attraction is what users describe as its intuitive syntax, pleasant expressiveness and brevity. (Compare those sentiments with your experience writing Ant files.)

The challenge of good language design is that it is little taught and rarely discussed. It remains tucked away as though it were the province of a cabal of specialists with Ph.Ds who scare the uninitiated with terms such as “monads” and “lambda calculus.”

In truth, it is not so rarefied a skill—and it’s one from which almost all large IT organizations can benefit, since nearly all such organizations have complex programmable in-house apps that represent part of the company’s unique competitive advantage. Writing a good language can be a huge contribution to getting things done better, faster, cheaper.

There are several landmark books that can help a new language designer do the job right. Unfortunately, they’re textbooks. But they do offer a deep understanding of the features that languages can have—in essence, providing the designer with a palette of many colors.

Two of the books are established classics: R.D. Tennet’s “Principles of Programming Languages” and Michael Scott’s “Programming Language Pragmatics.” While the former work was published in 1981, its content is still highly relevant and it is frequently cited in today’s discussions of the implementation of Java closures. The latter book focuses on pragmatics, which are the implementation aspects of a language. (The three principal phases of language implementation are syntax, semantics and pragmatics.) It discusses such topics as data type selection, object lifetimes and parameter processing.

Together, the two books cover the basics that good designers and implementers need. Tennet’s book, however, is a slim volume that does not cover all modern concepts.

To update the area completely, there’s the just-released “Design Concepts in Programming Languages,” by F. Turbak and D. Gifford. The book is comprehensive (at 1,300-plus pages) and presents numerous little languages to illustrate key concepts. One caveat: The material is dense and relies heavily on mathematical explanations, formal logic and Lisp-like language examples; in other words, it has a strongly academic feel. That will be forbidding to some readers, but the remarkably lucid style compensates well. And unlike the two other books, this one is so comprehensive as to be usable as an encyclopedic resource. Readers who use it as a reference volume can skip the math and symbols without much loss.

If you’re thinking of designing a language—large or small—spend extra time working on the design. You’ll attract more users, and they’ll be happier for the help you give them. If your view of what features a language should have is limited to the programming languages you’ve used, then start with Tennet’s book, follow up with Scott’s, and use Turbak and Gifford for updates and for reference. You’ll be pleased with the results.

Andrew Binstock is the principal analyst at Pacific Data Works. Read his blog at binstock.blogspot.com.


Related Search Term(s): software development


Share this link: http://www.sdtimes.com/link/32964
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading