Automatic programming
In computer science, the term automatic programming[1] identifies a type of computer programming in which some mechanism generates a computer program to allow human programmers to write the code at a higher abstraction level.
There has been little agreement on the precise definition of automatic programming, mostly because its meaning has changed over time. David Parnas, tracing the history of "automatic programming" in published research, noted that in the 1940s it described automation of the manual process of punching paper tape. Later it referred to translation of high-level programming languages like Fortran and ALGOL. In fact, one of the earliest programs identifiable as a compiler was called Autocode. Parnas concluded that "automatic programming has always been a euphemism for programming in a higher-level language than was then available to the programmer."[2]
Generative programming
Generative programming is a style of computer programming that uses automated source code creation through generic frames, classes, prototypes, templates, aspects, and code generators to improve programmer productivity[3]. It is often related to code-reuse topics such as component-based software engineering and product family engineering.
Source code generation
Source code generation is the act of generating source code based on an ontological model such as a template and is accomplished with a programming tool such as a template processor or an IDE. These tools allow the generation of source code through any of various means. A macro processor, such as the C preprocessor, which replaces patterns in source code according to relatively simple rules, is a simple form of source code generator.
Implementations
This page or section may contain link spam masquerading as content. (October 2010) |
IDEs such as Eclipse, Interface Builder and Microsoft Visual Studio have more advanced forms of source code generation, with which the programmer can interactively select and customize "snippets" of source code. Program "wizards", which allow the programmer to design graphical user interfaces interactively while the compiler invisibly generates the corresponding source code, are another common form of source code generation. This may be contrasted with, for example, user interface markup languages, which define user interfaces declaratively.
Besides the generation of code from a wizard or template, IDEs can also generate and manipulate code to automate code refactorings that would require multiple (error prone) manual steps, thereby improving developer productivity.[4] Examples of such features in IDEs are the refactoring class browsers for Smalltalk and those found in Java IDEs like IntelliJ and Eclipse.
A specialized alternative involves the generation of optimized code for quantities defined mathematically within a Computer algebra system (CAS). Compiler optimization consisting of finding common intermediates of a vector of size requires a complexity of or operations whereas the very design of a computer algebra system requires only operations[5][6]. These facilities can be used as pre-optimizer before processing by the compiler. This option has been used for handling mathematically large expressions in e.g. computational (quantum) chemistry.
Examples:
- Actifsource is a plugin for Eclipse that allows graphical modelling and model-based code generation using custom templates.
- Altova MapForce is a graphical data mapping, conversion, and integration tool capable of generating application code in Java, C#, or C++ for executing recurrent transformations.
- AtomWeaver is an Integrated Development Environment for Generative Programming using the ABSE modeling approach: A tree of cooperative mini-programs written in Lua will form a generator program that will generate the final target code.
- DMS Software Reengineering Toolkit is a system for defining arbitrary domain specific languages and translating them to other languages.
- Spring Roo is an open source active code generator for Spring Framework based Java applications. It uses AspectJ mixins to provide separation of concerns during round-trip maintenance.
- Tankogen is a tool for Model-driven development tailored for model transformation and source code generation. It is based on XPath and suggests the reuse of existing code generators to create higher-abstracted ones for any target language.
- RISE is a free information modeling suit for system development using ERD or UML. Database code generation for MySQL, PostgreSQL and Microsoft SQL Server. Persistence code generation for C# (.NET) and PHP including both SOAP and JSON style web services and AJAX proxy code.
- The Maple computer algebra system offers code generators optimizers with Fortran, C and Java. Mathematica and MuPAD have comparable interfaces.
See also
References
- ^ Ricardo Aler Mur, "Automatic Inductive Programming", ICML 2006 Tutorial. June 2006.
- ^ D. L. Parnas. "Software Aspects of Strategic Defense Systems." American Scientist. November 1985.
- ^ James Wilcox, "Paying Too Much for Custom Application Development", March 2011.
- ^ Martin Fowler, "Crossing Refactoring's Rubicon"
- ^ C. Gomez and T.C. Scott, Maple Programs for Generating Efficient FORTRAN Code for Serial and Vectorized Machines, Comput. Phys. Commun. 115, pp. 548-562, 1998 [1].
- ^ T.C. Scott, I.P. Grant, M.B. Monagan and V.R. Saunders, Numerical Computation of Molecular Integrals via optimized (vectorized) FORTRAN code, Proceedings of the Fifth International Workshop on New computing Techniques in Physics Research (Software Engineering, Neural Nets, Genetic Algorithms, Expert Systems, Symbolic Algebra, Automatic Calculations), held in Lausanne (Switzerland), Nucl. Instr. Meth. Phys. Res. 389, A, pp. 117-120, 1997 [2].
- Generative Programming: Methods, Tools, and Applications by Krzysztof Czarnecki and Ulrich W. Eisenecker, Addison Wesley, 2000.
External links
- Code Generation Network
- Generative Programming book site: www.generative-programming.org
- Code Generation In Action book site: http://www.codegeneration.net/cgia
- GPCE (Generative Programming and Component Engineering) conference
- Code Generation for Dummies
- Generative Programming Wiki
- FRAWA: FRAmework for Web Applications development
- myWay code generator
- AtomWeaver code generation IDE
- ABSE generative programming and code generation framework