Automatic programming

From HandWiki
Revision as of 23:53, 7 January 2024 by Mercury (talk | contribs) (→‎Source-code generation via Computer algebra)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Type of computer programming

In computer science, automatic programming[1] is 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]

Program synthesis is one type of automatic programming where a procedure is created from scratch, based on mathematical requirements.

Origin

Mildred Koss, an early UNIVAC programmer, explains: "Writing machine code involved several tedious steps—breaking down a process into discrete instructions, assigning specific memory locations to all the commands, and managing the I/O buffers. After following these steps to implement mathematical routines, a sub-routine library, and sorting programs, our task was to look at the larger programming process. We needed to understand how we might reuse tested code and have the machine help in programming. As we programmed, we examined the process and tried to think of ways to abstract these steps to incorporate them into higher-level language. This led to the development of interpreters, assemblers, compilers, and generators—programs designed to operate on or produce other programs, that is, automatic programming."[3]

Generative programming

Generative programming and the related term meta-programming[4] are concepts whereby programs can be written "to manufacture software components in an automated way"[5] just as automation has improved "production of traditional commodities such as garments, automobiles, chemicals, and electronics."[6][7]

The goal is to improve programmer productivity.[8] It is often related to code-reuse topics such as component-based software engineering.

Source-code generation

Source-code generation is the process of generating source code based on a description of the problem[9] or an ontological model such as a template and is accomplished with a programming tool such as a template processor or an integrated development environment (IDE). These tools allow the generation of source code through any of various means.

Modern programming languages are well supported by tools like Json4Swift (Swift) and Json2Kotlin (Kotlin).

Programs that could generate COBOL code include:

These application generators supported COBOL inserts and overrides.

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. Source-to-source code generation tools also exist.[11][12]

Code Generation via Computer Algebra

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 [math]\displaystyle{ n }[/math] requires a complexity of [math]\displaystyle{ O(n^2) }[/math] or [math]\displaystyle{ O(n^3) }[/math] operations whereas the very design of a computer algebra system requires only [math]\displaystyle{ O(n) }[/math] operations.[13][14][15] 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.

Low-code applications

A low-code development platform (LCDP) is software that provides an environment programmers use to create application software through graphical user interfaces and configuration instead of traditional computer programming.

See also

Notes

  1. Ricardo Aler Mur, "Automatic Inductive Programming ", ICML 2006 Tutorial. June 2006.
  2. D. L. Parnas. "Software Aspects of Strategic Defense Systems." American Scientist. November 1985.
  3. Chun, Wendy. "On Software, or the Persistence of Visual Knowledge." Grey Room 18. Boston: 2004, pg. 30.
  4. "About Generative Programming". https://scala-lms.github.io/tutorials/01_overview.html. "Generative programming, as a subdomain of meta-programming, describes the practice of writing programs that generate other programs as part of their execution." 
  5. P. Cointe (2005). "Towards Generative Programming". Unconventional Programming Paradigms. Lecture Notes in Computer Science. 3566. pp. 315–325. doi:10.1007/11527800_24. ISBN 978-3-540-27884-9. "Generative Programming (GP) is an attempt to manufacture software components in an automated way by developing programs that synthesize other programs." 
  6. "Generative Programming: Concepts and Experiences (GPCE)". http://www.sigplan.org/Conferences/GPCE. 
  7. A conference of SIGPLAN on this topic is planned for November 2018. Earlier/1970s attempts in this area included Yacc and the related Lex programs.
  8. James Wilcox, "Paying Too Much for Custom Application Development", March 2011.
  9. "Application generator". PCmag.com. https://www.pcmag.com/encyclopedia/term/37909/application-generator. "Software that generates application programs from descriptions of the problem rather than by traditional programming. It is at a higher level and easier to use than a high-level programming language such as ..." 
  10. "DYL-280 Command Syntax". http://www.sysed.com/DnLoads/RefCards/DYL280.pdf. 
  11. Noaje, Gabriel, Christophe Jaillet, and Michaël Krajecki. "Source-to-source code translator: OpenMP C to CUDA". High Performance Computing and Communications (HPCC), 2011 IEEE 13th International Conference on. IEEE, 2011.
  12. Quinlan, Dan, and Chunhua Liao. "The ROSE source-to-source compiler infrastructure". Cetus users and compiler infrastructure workshop, in conjunction with PACT. Vol. 2011. 2011.
  13. 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].
  14. T.C. Scott and Wenxing Zhang, Efficient hybrid-symbolic methods for quantum mechanical calculations, Comput. Phys. Commun. 191, pp. 221-234, 2015 [2].
  15. 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. Instrum. Methods Phys. Res. 389, A, pp. 117-120, 1997 [3].

References

  • Generative Programming: Methods, Tools, and Applications by Krzysztof Czarnecki and Ulrich W. Eisenecker, Addison Wesley, 2000.

External links