Abstract
Modern science commonly uses computer modelling. Thousands of scientific model are daily transformed to computers programs and tested. The transformation must overcome the gap between abstract human formal notation and low level semantics of contemporary programming languages. The simultaneous knowledge of specific scientific models and programming languages is an unpleasant necessity for a significant proportion of scientists and practitioners (engineers, economist, etc.). But a solution exists - accommodation of programming languages to mental models of their users. The article discuss one partial solution - implementation of domain specific languages in the heart of existing universal languages by mechanisms of metaprogramming. This mechanism overcomes limitations of classical programming languages and complexity of creation new languages from scratch. However, the support of metaprogramming in contemporary languages is limited to isolated and peripheral constructs in very few languages. These constructs are demonstrated by simplified but real examples (metaobject system of Python, monads in F# and macro-based metaprogramming of Boo language) together with discussion of their advantages and disadvantages. The discussion of examples is aimed to finding requirements for new languages and their implementation in a original (parent) language.
Highlights
The programming languages have been existing among us over sixty years
The programmer transforms the model into source code of his favourite programming language and compiler transform the source code into executable computer program
The implementation of metaprogramming language in Converge reuses some constructs based in Lisp semantic macros and quasi-quotations, and innovates specialized DSL constructs[16]
Summary
The programming languages have been existing among us over sixty years. the basic mechanisms of its application has not been changed anyway. The programmer transforms the model into source code of his (or her) favourite programming language and compiler transform the source code into executable computer program (see Figure 1, section “current model”) This (very simplified) chain of responsibilities has a lot of disadvantages. There is only one prefect solution of these problems — to make programmer from all persons, which are or potentially will be originators of formal models This ideal goal is reachable by two ways: 1. The fully specialized programming language have a potential to replace practitioner’s formal language in his brain, because it offers both alternative representation of formalism and medium for (inter-human) communication This language could be a bridge between practitioner and computer, simultaneous natural for both human being and computer (after compilation), see Figure 1 section “ideal model”. This final goal — thinking in programming language — is very distant in time, but some modern programming languages suggest a way
Published Version (Free)
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have