Extensible domain-specific programming for the sciences
Abstract:The notion of scientists as programmers begs the question of what sort of programming language would be a good fit. The common answer seems to be both none of them and all of them. Many scientific applications are a combination of general-purpose and domain-specific languages: R for statistical elements, MATLAB for matrix-based computations, Perl-based regular expressions for string matching, C or FORTRAN for high performance parallel computations, and scripting languages such as Python to glue them all together. This clumsy situation demonstrates the need for different domain-specific language features.
Our hypothesis is that programming could be made easier, less error-prone and result in higher-quality code if languages could be easily extended, by the programmer, with the domain-specific features that a programmer or scientists needs for their particular task at hand. This talk demonstrates the meta-language processing tools that support this composition of programmer-selected language features, with several extensions chosen from the previously mentioned list of features.
The paper, "Creating and using domain-specific language features",
Abstract: The value that domain-specific languages provide
to their users is the domain-specific language features they contain.
These features provide notations from the domain of interest, as well
as domain-specific analysis and optimizations. But domain-specific
languages are sometimes a poor means of delivering these
valuable features to their users. A challenge arises when a problem
crosses multiple domains and whose programming or modeling solution
could benefit from language features from all domains of interest.
Using multiple domain-specific languages can become cumbersome,
perhaps outweighing their benefits in the first place.
An alternative approach, advocated by this position paper, is to
provide domain-specific language features to programmers and
modelers as composable language extensions that they can import
into their general-purpose programming or modeling language. In our
view, there are three requirements for a language extension framework
to be widely usable. First, language extensions should be developed
independently, by domain-experts, as libraries or domain-specific
languages are now. Second, extensions should be automatically
composable so that programmers and modelers can pick the language
extensions they want, and direct tools to compose them, without the
need for writing ``glue-code.'' Third, this composition process
should not fail to yield a working compiler (or other tools)
for the custom extended language. Thus, the programmer has some
assurance that the extensions that they pick will work together.
We briefly describe how this vision of extensible language
frameworks is supported by the Silver and Copper meta-programming
Posted on July 28, 2013
Slides and paper from the Workshop on Scalable Language Specification
The paper, "Scaling language specifications to mainstream languages and
real-world applications", is available
Abstract:This paper describes two characteristics of
language specification tools that support their use at scales beyond
small prototypes. First is the ability to both explicitly and
implicitly (via translation) specify the semantics of language
constructs. In attribute grammars this achieved by forwarding
and is used to specify languages by building features on top of a
smaller core language. Second is the use of modular analyses on
language specifications to guarantee that their eventual composition
will have certain well-definedness properties.
So a couple of (previously) well-respected Harvard economists,
Carmen Reinhart and Kenneth Rogoff, wrote a paper that claimed that
when a country's debt-to-GDP ratio gets above 90 percent
of the country's economy, on average, shrinks. This work was very
influential in convincing governments that austerity was what their
Turns out - they were wrong. Their Excel spread sheet
But worse than that, they apparently refused to share their
data! I'm not sure how they got away with this. People
did complain about this back in 2010, but it is only now after
they've released their data that others have found flaws and simple
programming errors in their data.
So share your data. Someone may find your bugs before you
become famous for your results and then more famous because your
results turned out to be bogus.
Posted on April 20, 2013
The data sharing panda ...
This sad tale of the state of data sharing was shared by
Neil Chue Hong at the SI2 PI meeting this week. Worth a look...
Posted on January 19, 2013
Jimmy Stewart and the age of computing
The little men with the slide rules and computers are
going to inherit the earth.
These words were spoken by Jimmy Stewart in the role of
Captain Frain Towns in the 1965 film Flight of the
Phoenix. He was commenting on the engineer trying to fix
the downed plane.
We watched this film after a trip to my in-laws for
Christmas. We were talking to my father-in-law about his
service in WWII and it came up that a plane he used to fly in
was featured in nearly every scene of the film. So we watched
Posted on January 1, 2013
Slides from my talk at Lund University
Abstract: Extensible programming and modeling
languages allow their users to import new features into their
language. These may be new syntax (notations), new semantics
(e.g. analysis for additional error checking), new
optimizations, and new translations. These are all packaged
as language extensions. Ideally, programmers and engineers
with no knowledge of language design or implementation can
direct tools to compose a "host" language with their chosen
set of language extensions resulting in a custom translator or
compiler for their extended language. Furthermore, these
users should have some assurances that the composition of
these independently developed language extensions will in fact
This talk describes Silver and Copper - two language
processing tools that support the model of language extension
and a set of static composition analyses that ensure that the
composition process will be successful. These modular analyses
allow extension developers to verify that their extension will
compose with other similarly verified extensions. These
analyses ensures that the resulting scanner and parser are
deterministic (non-ambiguous) and that the attribute grammar
is well-defined (not missing definitions). A monolithic
(whole language) non-termination analysis for higher-order
attribute grammars will also be discussed.
Posted on September 17, 2012
The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.